diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2020-01-04 10:12:32 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2020-01-26 15:50:13 -0500 |
commit | 08d22f03eae6038f392a99b14dcfd2e78cca2a04 (patch) | |
tree | 6fdd8eac00d431a291b291bd8a5ea9b7b89037a6 /dom/bindings/parser/WebIDL.py | |
parent | ba8fb9dc587b982643d2e1503a4373b4380d64d7 (diff) | |
download | UXP-08d22f03eae6038f392a99b14dcfd2e78cca2a04.tar UXP-08d22f03eae6038f392a99b14dcfd2e78cca2a04.tar.gz UXP-08d22f03eae6038f392a99b14dcfd2e78cca2a04.tar.lz UXP-08d22f03eae6038f392a99b14dcfd2e78cca2a04.tar.xz UXP-08d22f03eae6038f392a99b14dcfd2e78cca2a04.zip |
Bug 1309147 - Part 1: Implement the support for CEReactions in WebIDL parser.
Tag UXP Issue #1344
Diffstat (limited to 'dom/bindings/parser/WebIDL.py')
-rw-r--r-- | dom/bindings/parser/WebIDL.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/dom/bindings/parser/WebIDL.py b/dom/bindings/parser/WebIDL.py index a89620a9f..81911996d 100644 --- a/dom/bindings/parser/WebIDL.py +++ b/dom/bindings/parser/WebIDL.py @@ -4083,6 +4083,11 @@ class IDLAttribute(IDLInterfaceMember): raise WebIDLError("Attribute returns a type that is not exposed " "everywhere where the attribute is exposed", [self.location]) + if self.getExtendedAttribute("CEReactions"): + if self.readonly: + raise WebIDLError("[CEReactions] is not allowed on " + "readonly attributes", + [self.location]) def handleExtendedAttribute(self, attr): identifier = attr.identifier() @@ -4253,6 +4258,10 @@ class IDLAttribute(IDLInterfaceMember): raise WebIDLError("[Unscopable] is only allowed on non-static " "attributes and operations", [attr.location, self.location]) + elif identifier == "CEReactions": + if not attr.noArguments(): + raise WebIDLError("[CEReactions] must take no arguments", + [attr.location]) elif (identifier == "Pref" or identifier == "Deprecated" or identifier == "SetterThrows" or @@ -4983,6 +4992,15 @@ class IDLMethod(IDLInterfaceMember, IDLScope): raise WebIDLError("[Unscopable] is only allowed on non-static " "attributes and operations", [attr.location, self.location]) + elif identifier == "CEReactions": + if not attr.noArguments(): + raise WebIDLError("[CEReactions] must take no arguments", + [attr.location]) + + if self.isSpecial() and not self.isSetter() and not self.isDeleter(): + raise WebIDLError("[CEReactions] is only allowed on operation, " + "attribute, setter, and deleter", + [attr.location, self.location]) elif (identifier == "Throws" or identifier == "NewObject" or identifier == "ChromeOnly" or |