mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Implement [LegacyUnenumerableNamedProperties] in the WebIDL parser
http://github.com/heycam/webidl/issues/82
This commit is contained in:
parent
3550993075
commit
c95855c7ea
3 changed files with 34 additions and 1 deletions
|
@ -1069,6 +1069,12 @@ class IDLInterface(IDLObjectWithScope, IDLExposureMixins):
|
|||
|
||||
specialMembersSeen[memberType] = member
|
||||
|
||||
if (self.getExtendedAttribute("LegacyUnenumerableNamedProperties") and
|
||||
"named getters" not in specialMembersSeen):
|
||||
raise WebIDLError("[LegacyUnenumerableNamedProperties] used on an interface "
|
||||
"without a named getter",
|
||||
[self.location])
|
||||
|
||||
if self._isOnGlobalProtoChain:
|
||||
# Make sure we have no named setters, creators, or deleters
|
||||
for memberType in ["setter", "creator", "deleter"]:
|
||||
|
@ -1417,7 +1423,8 @@ class IDLInterface(IDLObjectWithScope, IDLExposureMixins):
|
|||
identifier == "UnsafeInPrerendering" or
|
||||
identifier == "LegacyEventInit" or
|
||||
identifier == "ProbablyShortLivingObject" or
|
||||
identifier == "Abstract"):
|
||||
identifier == "Abstract" or
|
||||
identifier == "LegacyUnenumerableNamedProperties"):
|
||||
# Known extended attributes that do not take values
|
||||
if not attr.noArguments():
|
||||
raise WebIDLError("[%s] must take no arguments" % identifier,
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
--- WebIDL.py
|
||||
+++ WebIDL.py
|
||||
@@ -1069,6 +1069,12 @@ class IDLInterface(IDLObjectWithScope, IDLExposureMixins):
|
||||
|
||||
specialMembersSeen[memberType] = member
|
||||
|
||||
+ if (self.getExtendedAttribute("LegacyUnenumerableNamedProperties") and
|
||||
+ "named getters" not in specialMembersSeen):
|
||||
+ raise WebIDLError("[LegacyUnenumerableNamedProperties] used on an interface "
|
||||
+ "without a named getter",
|
||||
+ [self.location])
|
||||
+
|
||||
if self._isOnGlobalProtoChain:
|
||||
# Make sure we have no named setters, creators, or deleters
|
||||
for memberType in ["setter", "creator", "deleter"]:
|
||||
@@ -1417,7 +1423,8 @@ class IDLInterface(IDLObjectWithScope, IDLExposureMixins):
|
||||
identifier == "UnsafeInPrerendering" or
|
||||
identifier == "LegacyEventInit" or
|
||||
identifier == "ProbablyShortLivingObject" or
|
||||
- identifier == "Abstract"):
|
||||
+ identifier == "Abstract" or
|
||||
+ identifier == "LegacyUnenumerableNamedProperties"):
|
||||
# Known extended attributes that do not take values
|
||||
if not attr.noArguments():
|
||||
raise WebIDLError("[%s] must take no arguments" % identifier,
|
|
@ -1,4 +1,5 @@
|
|||
wget https://mxr.mozilla.org/mozilla-central/source/dom/bindings/parser/WebIDL.py?raw=1 -O WebIDL.py
|
||||
patch < abstract.patch
|
||||
patch < legacy-unenumerable-named-properties.patch
|
||||
|
||||
# TODO: update test files from https://dxr.mozilla.org/mozilla-central/source/dom/bindings/parser/tests
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue