Skip to content

Commit 9a1585e

Browse files
authored
fix: missing extattr validation for arguments/operations (#567)
1 parent 4a63113 commit 9a1585e

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

lib/productions/argument.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export class Argument extends Base {
6161
* @param {import("../validator.js").Definitions} defs
6262
*/
6363
*validate(defs) {
64+
yield* this.extAttrs.validate(defs);
6465
yield* this.idlType.validate(defs);
6566
const result = idlTypeIncludesDictionary(this.idlType, defs, {
6667
useNullableInner: true,

lib/productions/operation.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export class Operation extends Base {
6363
}
6464

6565
*validate(defs) {
66+
yield* this.extAttrs.validate(defs);
6667
if (!this.name && ["", "static"].includes(this.special)) {
6768
const message = `Regular or static operations must have both a return type and an identifier.`;
6869
yield validationError(this.tokens.open, this, "incomplete-op", message);

test/autofix.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,9 @@ describe("Writer template functions", () => {
299299
[LenientSetter] readonly attribute DOMString lenientSetter;
300300
[LenientThis] readonly attribute DOMString lenientThis;
301301
attribute [TreatNullAs] DOMString treatNullAs;
302+
undefined treatNullAsOp([TreatNullAs] DOMString str);
302303
[Unforgeable] readonly attribute DOMString unforgeable;
304+
[Unforgeable] DOMString unforgeableOp();
303305
};
304306
305307
[TreatNonObjectAsNull]
@@ -314,7 +316,9 @@ describe("Writer template functions", () => {
314316
[LegacyLenientSetter] readonly attribute DOMString lenientSetter;
315317
[LegacyLenientThis] readonly attribute DOMString lenientThis;
316318
attribute [LegacyNullToEmptyString] DOMString treatNullAs;
319+
undefined treatNullAsOp([LegacyNullToEmptyString] DOMString str);
317320
[LegacyUnforgeable] readonly attribute DOMString unforgeable;
321+
[LegacyUnforgeable] DOMString unforgeableOp();
318322
};
319323
320324
[LegacyTreatNonObjectAsNull]

0 commit comments

Comments
 (0)