diff --git a/package-lock.json b/package-lock.json index 99202fdd..73b7c2a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -102,7 +102,7 @@ "sinon": "21.0.0", "typescript": "5.8.3", "typescript-eslint": "^8.38.0", - "webidl2": "24.4.1", + "webidl2": "24.5.0", "yaml": "2.8.0" }, "engines": { @@ -17152,13 +17152,13 @@ "license": "BSD-2-Clause" }, "node_modules/webidl2": { - "version": "24.4.1", - "resolved": "https://registry.npmjs.org/webidl2/-/webidl2-24.4.1.tgz", - "integrity": "sha512-cPToqvZlxTAlaMucZyU28XtFLJz3XPdTdIWK/r3IaP1jfkjqne3OTniJS8DZqfzee1aBUQn80d6s2vYert50kg==", + "version": "24.5.0", + "resolved": "https://registry.npmjs.org/webidl2/-/webidl2-24.5.0.tgz", + "integrity": "sha512-fxOigKkIem1iAgQ9t4cFOP+kWEA8y6Be/uh50FpJh0FijoeeT/VMrOyJzNLUgjy0rGMEcHeReKDCqj0g9dIe9A==", "dev": true, "license": "W3C", "engines": { - "node": ">= 14" + "node": ">= 18" } }, "node_modules/whatwg-encoding": { diff --git a/package.json b/package.json index bb3d4528..93ed21fd 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ "sinon": "21.0.0", "typescript": "5.8.3", "typescript-eslint": "^8.38.0", - "webidl2": "24.4.1", + "webidl2": "24.5.0", "yaml": "2.8.0" } } diff --git a/test-builder/api.test.ts b/test-builder/api.test.ts index 5546d69e..453ed54e 100644 --- a/test-builder/api.test.ts +++ b/test-builder/api.test.ts @@ -660,7 +660,7 @@ describe("build (API)", () => { const ast = WebIDL2.parse( `[Exposed=Window] interface ReadableStream { - async iterable; + async_iterable; };`, ); assert.deepEqual(await buildIDLTests(ast, [], scopes), { @@ -683,7 +683,7 @@ describe("build (API)", () => { const ast = WebIDL2.parse( `[Exposed=Window] interface AsyncMap { - async iterable; + async_iterable; };`, ); assert.deepEqual(await buildIDLTests(ast, [], scopes), { diff --git a/test-builder/api.ts b/test-builder/api.ts index 868c0c5b..442e3673 100644 --- a/test-builder/api.ts +++ b/test-builder/api.ts @@ -213,7 +213,8 @@ const flattenMembers = (iface) => { members.push({name: iface.name, type: "constructor"}); break; case "iterable": - if (member.async) { + case "async_iterable": + if (member.async || member.type === "async_iterable") { // https://webidl.spec.whatwg.org/#idl-async-iterable members.push( {name: "@@asyncIterator", type: "symbol"}, @@ -404,10 +405,13 @@ const getExposureSet = (node, scopes): Set => { const validateIDL = (ast) => { const validations = WebIDL2.validate(ast).filter((v) => { // Ignore the [LegacyNoInterfaceObject] rule. - // XXX Also temporarily ignore the "[AllowShared] BufferSource -> AllowSharedBufferSource" rule until specs are fixed. - return !["no-nointerfaceobject", "migrate-allowshared"].includes( - v.ruleName, - ); + // Also ignore the "async iterable -> async_iterable" rule until specs are fixed. + // Also ignore the rule that dictionary arguments without required fields must be marked optional (until the RTC spec is fixed) + return ![ + "no-nointerfaceobject", + "obsolete-async-iterable-syntax", + "dict-arg-optional", + ].includes(v.ruleName); }); if (validations.length) { const message = validations