mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Assert that we're constructing.
This commit is contained in:
parent
62e0768635
commit
b14b4726ac
1 changed files with 2 additions and 1 deletions
|
@ -12,6 +12,7 @@ use crate::dom::bindings::guard::Guard;
|
||||||
use crate::dom::bindings::principals::ServoJSPrincipals;
|
use crate::dom::bindings::principals::ServoJSPrincipals;
|
||||||
use crate::dom::bindings::utils::{
|
use crate::dom::bindings::utils::{
|
||||||
get_proto_or_iface_array, DOMJSClass, ProtoOrIfaceArray, DOM_PROTOTYPE_SLOT, JSCLASS_DOM_GLOBAL,
|
get_proto_or_iface_array, DOMJSClass, ProtoOrIfaceArray, DOM_PROTOTYPE_SLOT, JSCLASS_DOM_GLOBAL,
|
||||||
|
callargs_is_constructing,
|
||||||
};
|
};
|
||||||
use crate::script_runtime::JSContext as SafeJSContext;
|
use crate::script_runtime::JSContext as SafeJSContext;
|
||||||
use js::error::throw_type_error;
|
use js::error::throw_type_error;
|
||||||
|
@ -626,7 +627,7 @@ pub fn get_desired_proto(
|
||||||
// https://heycam.github.io/webidl/#internally-create-a-new-object-implementing-the-interface
|
// https://heycam.github.io/webidl/#internally-create-a-new-object-implementing-the-interface
|
||||||
// step 3.
|
// step 3.
|
||||||
|
|
||||||
//assert!(args.is_constructing())
|
assert!(callargs_is_constructing(args));
|
||||||
|
|
||||||
// The desired prototype depends on the actual constructor that was invoked,
|
// The desired prototype depends on the actual constructor that was invoked,
|
||||||
// which is passed to us as the newTarget in the callargs. We want to do
|
// which is passed to us as the newTarget in the callargs. We want to do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue