aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2016-02-17 01:46:50 +0100
committerAnthony Ramine <n.oxyde@gmail.com>2016-02-17 13:58:58 +0100
commitc21a1643965b052f2ca7324081f06971319351b6 (patch)
treeb077c1ada5e27bf2f60d70e04add5dad1a000446 /components/script/dom/bindings/codegen/CodegenRust.py
parent6c874c929fda437b3f7761fed2e6afc46c3e1ee4 (diff)
downloadservo-c21a1643965b052f2ca7324081f06971319351b6.tar.gz
servo-c21a1643965b052f2ca7324081f06971319351b6.zip
Support [ExceptionClass]
Use it on DOMException.
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 13b65f53f29..ea16360841d 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -2391,9 +2391,11 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
return CGGeneric("""\
create_callback_interface_object(cx, receiver, sConstants, %s);""" % str_to_const_array(name))
- protoChain = self.descriptor.prototypeChain
- if len(protoChain) == 1:
- getPrototypeProto = "prototype_proto.ptr = JS_GetObjectPrototype(cx, global)"
+ if len(self.descriptor.prototypeChain) == 1:
+ if self.descriptor.interface.getExtendedAttribute("ExceptionClass"):
+ getPrototypeProto = "prototype_proto.ptr = JS_GetErrorPrototype(cx)"
+ else:
+ getPrototypeProto = "prototype_proto.ptr = JS_GetObjectPrototype(cx, global)"
else:
getPrototypeProto = ("%s::GetProtoObject(cx, global, receiver, prototype_proto.handle_mut())" %
toBindingNamespace(self.descriptor.prototypeChain[-2]))
@@ -5340,10 +5342,10 @@ class CGBindingRoot(CGThing):
'js::jsapi::{HandleId, HandleObject, HandleValue, HandleValueArray}',
'js::jsapi::{INTERNED_STRING_TO_JSID, IsCallable, JS_CallFunctionValue}',
'js::jsapi::{JS_ComputeThis, JS_CopyPropertiesFrom, JS_ForwardGetPropertyTo}',
- 'js::jsapi::{JS_GetClass, JS_GetFunctionPrototype, JS_GetGlobalForObject}',
- 'js::jsapi::{JS_GetObjectPrototype, JS_GetProperty, JS_GetPropertyById}',
- 'js::jsapi::{JS_GetPropertyDescriptorById, JS_GetReservedSlot, JS_HasProperty}',
- 'js::jsapi::{JS_HasPropertyById, JS_InitializePropertiesFromCompatibleNativeObject}',
+ 'js::jsapi::{JS_GetClass, JS_GetErrorPrototype, JS_GetFunctionPrototype}',
+ 'js::jsapi::{JS_GetGlobalForObject, JS_GetObjectPrototype, JS_GetProperty}',
+ 'js::jsapi::{JS_GetPropertyById, JS_GetPropertyDescriptorById, JS_GetReservedSlot}',
+ 'js::jsapi::{JS_HasProperty, JS_HasPropertyById, JS_InitializePropertiesFromCompatibleNativeObject}',
'js::jsapi::{JS_InternString, JS_IsExceptionPending, JS_NewObject, JS_NewObjectWithGivenProto}',
'js::jsapi::{JS_NewObjectWithoutMetadata, JS_NewStringCopyZ, JS_SetProperty}',
'js::jsapi::{JS_SetPrototype, JS_SetReservedSlot, JS_WrapValue, JSAutoCompartment}',