Bug 997285 part 2. Add [ExceptionClass] support to WebIDL. r=peterv

This commit is contained in:
Boris Zbarsky 2014-05-05 16:01:57 -04:00
parent 953e8d707f
commit ad342c8e55
2 changed files with 10 additions and 0 deletions

View File

@ -2328,6 +2328,8 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
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:

View File

@ -968,6 +968,14 @@ class IDLInterface(IDLObjectWithScope):
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",