Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webidl2

Package Overview
Dependencies
Maintainers
1
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webidl2 - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

.gitmodules

32

lib/webidl2.js

@@ -11,3 +11,3 @@

, "string": /^"[^"]*"/
, "whitespace": /^[\t\n\r ]+|[\t\n\r ]*((\/\/.*|\/\*(.|\n)*?\*\/)[\t\n\r ]*)+/
, "whitespace": /^(?:[\t\n\r ]+|[\t\n\r ]*((\/\/.*|\/\*(.|\n|\r)*?\*\/)[\t\n\r ]*))+/
, "other": /^[^\t\n\r 0-9A-Z_a-z]/

@@ -30,3 +30,3 @@ }

if (matched) continue;
throw new Error("Token stream not progressing.");
throw new Error("Token stream not progressing");
}

@@ -47,2 +47,13 @@ return tokens;

var WebIDLParseError = function (str, line, input, tokens) {
this.message = str;
this.line = line;
this.input = input;
this.tokens = tokens;
};
WebIDLParseError.prototype.toString = function () {
return this.message + ", line " + this.line + " (tokens: '" + this.input + "')\n" +
JSON.stringify(this.tokens, null, 4);
};
var error = function (str) {

@@ -54,3 +65,3 @@ var tok = "", numTokens = 0, maxTokens = 5;

}
throw str + ", line " + line + " (tokens: '" + tok + "')\n" + JSON.stringify(tokens.slice(0, 5), null, 4);
throw new WebIDLParseError(str, line, tok, tokens.slice(0, 5));
};

@@ -140,3 +151,6 @@

all_ws();
if (consume(OTHER, "?")) obj.nullable = true;
if (consume(OTHER, "?")) {
if (obj.nullable) error("Can't nullable more than once");
obj.nullable = true;
}
else if (consume(OTHER, "[")) {

@@ -180,2 +194,3 @@ all_ws();

type_suffix(ret);
if (ret.nullable && ret.idlType === "any") error("Type any cannot be made nullable");
return ret;

@@ -427,2 +442,3 @@ };

ret.idlType = type() || error("No type in attribute");
if (ret.idlType.sequence) error("Attributes cannot accept sequence types");
all_ws();

@@ -503,2 +519,3 @@ var name = consume(ID) || error("No name in attribute");

consume(OTHER, ";") || error("Unterminated iterator");
return ret;
}

@@ -580,2 +597,4 @@ else {

else {
ret.idlType = return_type();
all_ws();
ret.operation = operation_rest();

@@ -813,4 +832,5 @@ }

};
return definitions();
var res = definitions();
if (tokens.length) error("Unrecognised tokens");
return res;
};

@@ -817,0 +837,0 @@

10

package.json
{
"name": "webidl2"
, "description": "A WebIDL Parser"
, "version": "2.0.0"
, "version": "2.0.1"
, "author": "Robin Berjon <robin@berjon.com>"

@@ -9,8 +9,8 @@ , "dependencies": {

, "devDependencies": {
"mocha": "*"
, "should": "*"
, "underscore": "*"
"mocha": "1.7.4"
, "expect.js": "0.2.0"
, "underscore": "1.4.3"
, "jsondiffpatch": "*"
, "benchmark": "*"
, "microtime": "*"
, "microtime": "*"
}

@@ -17,0 +17,0 @@ , "repository": "git://github.com/darobin/webidl2.js"

Installation
============
Just the usual:
npm install webidl2
Testing
=======
In order to run the tests you need to ensure that the widlproc submodule inside `test` is
initialised and up to date:
git submodule init
# or
git submodule update
TODO
====
* run coverage to see if there's any glaring omission in the tests
* test in browser
* document
* test invalid WebIDL too
* review the test JSONs to for correctness

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc