Skip to content

Commit f1bb3f0

Browse files
authored
Merge 7ad1bd2 into 0085e16
2 parents 0085e16 + 7ad1bd2 commit f1bb3f0

26 files changed

+2287
-1945
lines changed

resources/webidl2/README.md

Lines changed: 380 additions & 346 deletions
Large diffs are not rendered by default.

resources/webidl2/lib/webidl2.js

Lines changed: 1050 additions & 978 deletions
Large diffs are not rendered by default.

resources/webidl2/lib/writer.js

Lines changed: 269 additions & 225 deletions
Large diffs are not rendered by default.

resources/webidl2/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"name": "webidl2",
33
"description": "A WebIDL Parser",
4-
"version": "2.0.11",
4+
"version": "2.4.0",
55
"author": "Robin Berjon <[email protected]>",
66
"license": "MIT",
77
"dependencies": {},
88
"devDependencies": {
9-
"mocha": "2.2.5",
10-
"expect.js": "0.3.1",
9+
"mocha": "3.2.0",
10+
"expect": "1.20.2",
1111
"underscore": "1.8.3",
12-
"jsondiffpatch": "0.1.31",
12+
"jsondiffpatch": "0.2.4",
1313
"benchmark": "*",
14-
"microtime": "1.4.2"
14+
"microtime": "2.1.3"
1515
},
1616
"scripts": {
1717
"test": "mocha"

resources/webidl2/test/invalid.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// are fully correct interpretations of the IDLs
55

66
var wp = process.env.JSCOV ? require("../lib-cov/webidl2") : require("../lib/webidl2")
7-
, expect = require("expect.js")
7+
, expect = require("expect")
88
, pth = require("path")
99
, fs = require("fs")
1010
;
@@ -16,7 +16,7 @@ describe("Parses all of the invalid IDLs to check that they blow up correctly",
1616
.map(function (it) { return pth.join(dir, it); })
1717
, errors = idls.map(function (it) { return pth.join(__dirname, "invalid", "json", pth.basename(it).replace(/\.w?idl/, ".json")); })
1818
;
19-
19+
2020
for (var i = 0, n = idls.length; i < n; i++) {
2121
var idl = idls[i], error = JSON.parse(fs.readFileSync(errors[i], "utf8"));
2222
var func = (function (idl, err) {
@@ -30,11 +30,11 @@ describe("Parses all of the invalid IDLs to check that they blow up correctly",
3030
error = e;
3131
}
3232
finally {
33-
expect(error).to.be.ok();
34-
expect(error.message).to.equal(err.message);
35-
expect(error.line).to.equal(err.line);
33+
expect(error).toExist();
34+
expect(error.message).toEqual(err.message);
35+
expect(error.line).toEqual(err.line);
3636
}
37-
37+
3838
};
3939
}(idl, error));
4040
it("should produce the right error for " + idl, func);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
interface Foo {
2+
void foo(record<octet, any> param);
3+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"message": "Record key must be DOMString, USVString, or ByteString",
3+
"line": 2
4+
}

resources/webidl2/test/syntax.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
var wp = process.env.JSCOV ? require("../lib-cov/webidl2") : require("../lib/webidl2")
3-
, expect = require("expect.js")
3+
, expect = require("expect")
44
, pth = require("path")
55
, fs = require("fs")
66
, jdp = require("jsondiffpatch")
@@ -14,7 +14,7 @@ describe("Parses all of the IDLs to produce the correct ASTs", function () {
1414
.map(function (it) { return pth.join(dir, it); })
1515
, jsons = idls.map(function (it) { return pth.join(__dirname, "syntax/json", pth.basename(it).replace(".widl", ".json")); })
1616
;
17-
17+
1818
for (var i = 0, n = idls.length; i < n; i++) {
1919
var idl = idls[i], json = jsons[i];
2020

@@ -28,7 +28,7 @@ describe("Parses all of the IDLs to produce the correct ASTs", function () {
2828
var diff = jdp.diff(JSON.parse(fs.readFileSync(json, "utf8")),
2929
wp.parse(fs.readFileSync(idl, "utf8"), opt));
3030
if (diff && debug) console.log(JSON.stringify(diff, null, 4));
31-
expect(diff).to.be(undefined);
31+
expect(diff).toBe(undefined);
3232
}
3333
catch (e) {
3434
console.log(e.toString());

resources/webidl2/test/syntax/idl/extended-attributes.widl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,9 @@
33
[Global=(Worker,ServiceWorker), Exposed=ServiceWorker]
44
interface ServiceWorkerGlobalScope : WorkerGlobalScope {
55

6-
};
6+
};
7+
8+
// Conformance with ExtendedAttributeList grammar in http://www.w3.org/TR/WebIDL/#idl-extended-attributes
9+
// Section 3.11
10+
[IntAttr=0, FloatAttr=3.14, StringAttr="abc"]
11+
interface IdInterface {};

resources/webidl2/test/syntax/idl/map.widl

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)