Bug 997285 part 2. Add [ExceptionClass] support to WebIDL. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 05 May 2014 16:01:57 -0400
changeset 181838 3a949414f5bcf52f7b02b065a734b9a52abdd83e
parent 181837 a4d9d03ecfdf3436f6492f3b2cea7215ec69e6a8
child 181839 bceaeae2f7af4302b63b9092a7a729f24faa924b
push id43150
push userbzbarsky@mozilla.com
push dateTue, 06 May 2014 20:53:55 +0000
treeherdermozilla-inbound@1ef41f4b806d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs997285
milestone32.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 997285 part 2. Add [ExceptionClass] support to WebIDL. r=peterv
dom/bindings/Codegen.py
dom/bindings/parser/WebIDL.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -2323,16 +2323,18 @@ class CGCreateInterfaceObjectsMethod(CGA
         CGAbstractMethod.__init__(self, descriptor, 'CreateInterfaceObjects', 'void', args)
         self.properties = properties
 
     def definition_body(self):
         if len(self.descriptor.prototypeChain) == 1:
             parentProtoType = "Rooted"
             if self.descriptor.interface.getExtendedAttribute("ArrayClass"):
                 getParentProto = "aCx, JS_GetArrayPrototype(aCx, aGlobal)"
+            elif self.descriptor.interface.getExtendedAttribute("ExceptionClass"):
+                getParentProto = "aCx, JS_GetErrorPrototype(aCx)"
             else:
                 getParentProto = "aCx, JS_GetObjectPrototype(aCx, aGlobal)"
         else:
             parentProtoName = self.descriptor.prototypeChain[-2]
             parentDesc = self.descriptor.getDescriptor(parentProtoName)
             if parentDesc.workers:
                 parentProtoName += '_workers'
             getParentProto = ("%s::GetProtoObject(aCx, aGlobal)" %
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -963,16 +963,24 @@ class IDLInterface(IDLObjectWithScope):
             elif (identifier == "ArrayClass"):
                 if not attr.noArguments():
                     raise WebIDLError("[ArrayClass] must take no arguments",
                                       [attr.location])
                 if self.parent:
                     raise WebIDLError("[ArrayClass] must not be specified on "
                                       "an interface with inherited interfaces",
                                       [attr.location, self.location])
+            elif (identifier == "ExceptionClass"):
+                if not attr.noArguments():
+                    raise WebIDLError("[ExceptionClass] must take no arguments",
+                                      [attr.location])
+                if self.parent:
+                    raise WebIDLError("[ExceptionClass] must not be specified on "
+                                      "an interface with inherited interfaces",
+                                      [attr.location, self.location])
             elif identifier == "Global":
                 if not attr.noArguments():
                     raise WebIDLError("[Global] must take no arguments",
                                       [attr.location])
                 self._isOnGlobalProtoChain = True
             elif (identifier == "NeedNewResolve" or
                   identifier == "OverrideBuiltins" or
                   identifier == "ChromeOnly"):