Bug 1277401 part 3. Add IDL parser support for [Func] on dictionary members. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 07 Jun 2016 10:34:54 -0400
changeset 300873 cd91042c6a8b0592afb34f7d503d5957b74263bf
parent 300872 42aa63e1c573df6139e8fcdd7713c24a6e8dfa92
child 300874 759fdef36b82043a3a95a830d686d0903f4a28fc
push id78112
push userbzbarsky@mozilla.com
push dateTue, 07 Jun 2016 14:34:41 +0000
treeherdermozilla-inbound@44182df66982 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1277401
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1277401 part 3. Add IDL parser support for [Func] on dictionary members. r=peterv
dom/bindings/parser/WebIDL.py
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -4397,20 +4397,21 @@ class IDLArgument(IDLObjectWithIdentifie
                     raise WebIDLError("[EnforceRange] must take no arguments",
                                       [attribute.location])
                 if self.clamp:
                     raise WebIDLError("[EnforceRange] and [Clamp] are mutually exclusive",
                                       [self.location])
                 self.enforceRange = True
             elif identifier == "TreatNonCallableAsNull":
                 self._allowTreatNonCallableAsNull = True
-            elif self.dictionaryMember and identifier == "ChromeOnly":
+            elif (self.dictionaryMember and
+                  (identifier == "ChromeOnly" or identifier == "Func")):
                 if not self.optional:
-                    raise WebIDLError("[ChromeOnly] must not be used on a required "
-                                      "dictionary member",
+                    raise WebIDLError("[%s] must not be used on a required "
+                                      "dictionary member" % identifier,
                                       [attribute.location])
             else:
                 raise WebIDLError("Unhandled extended attribute on %s" %
                                   ("a dictionary member" if self.dictionaryMember else
                                    "an argument"),
                                   [attribute.location])
             attrlist = attribute.listValue()
             self._extendedAttrDict[identifier] = attrlist if len(attrlist) else True