mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Auto merge of #9676 - nox:domexception, r=KiChjang
Support [ExceptionClass] Use it on DOMException. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9676) <!-- Reviewable:end -->
This commit is contained in:
commit
61f09cce4e
4 changed files with 13 additions and 17 deletions
|
@ -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}',
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
/*
|
||||
* The origin of this IDL file is:
|
||||
* https://dom.spec.whatwg.org/#domexception
|
||||
|
||||
/* https://heycam.github.io/webidl/#es-DOMException
|
||||
* https://heycam.github.io/webidl/#es-DOMException-constructor-object
|
||||
*/
|
||||
|
||||
// XXXkhuey this is an 'exception', not an interface, but we don't have any
|
||||
// parser or codegen mechanisms for dealing with exceptions.
|
||||
[ExceptionClass]
|
||||
interface DOMException {
|
||||
const unsigned short INDEX_SIZE_ERR = 1;
|
||||
const unsigned short DOMSTRING_SIZE_ERR = 2; // historical
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
[existence and properties of DOMException]
|
||||
expected: FAIL
|
||||
|
||||
[existence and properties of DOMException.prototype]
|
||||
expected: FAIL
|
||||
|
||||
[existence of name and code properties on DOMException.prototype]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
[existence and properties of DOMException]
|
||||
expected: FAIL
|
||||
|
||||
[existence and properties of DOMException.prototype]
|
||||
expected: FAIL
|
||||
|
||||
[existence of name and code properties on DOMException.prototype]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue