mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update js.
This commit is contained in:
parent
ba2fb4e2e2
commit
558afe1786
8 changed files with 14 additions and 14 deletions
|
@ -2936,7 +2936,7 @@ assert!(!unforgeable_holder.is_null());
|
|||
code.append(InitUnforgeablePropertiesOnHolder(self.descriptor, self.properties))
|
||||
code.append(CGGeneric("""\
|
||||
JS_SetReservedSlot(prototype.get(), DOM_PROTO_UNFORGEABLE_HOLDER_SLOT,
|
||||
ObjectValue(&*unforgeable_holder.get()))"""))
|
||||
ObjectValue(unforgeable_holder.get()))"""))
|
||||
|
||||
return CGList(code, "\n")
|
||||
|
||||
|
@ -6607,7 +6607,7 @@ class CallCallback(CallbackMethod):
|
|||
return "aThisObj.get()"
|
||||
|
||||
def getCallableDecl(self):
|
||||
return "rooted!(in(cx) let callable = ObjectValue(&*self.parent.callback()));\n"
|
||||
return "rooted!(in(cx) let callable = ObjectValue(self.parent.callback()));\n"
|
||||
|
||||
def getCallGuard(self):
|
||||
if self.callback._treatNonObjectAsNull:
|
||||
|
@ -6646,7 +6646,7 @@ class CallbackOperationBase(CallbackMethod):
|
|||
'rooted!(in(cx) let callable =\n' +
|
||||
CGIndenter(
|
||||
CGIfElseWrapper('isCallable',
|
||||
CGGeneric('ObjectValue(&*self.parent.callback())'),
|
||||
CGGeneric('ObjectValue(self.parent.callback())'),
|
||||
CGGeneric(getCallableFromProp))).define() + ');\n')
|
||||
|
||||
def getCallGuard(self):
|
||||
|
@ -6734,10 +6734,10 @@ class CGIterableMethodGenerator(CGGeneric):
|
|||
throw_type_error(cx, "Argument 1 of ${ifaceName}.forEach is not callable.");
|
||||
return false;
|
||||
}
|
||||
rooted!(in(cx) let arg0 = ObjectValue(&*arg0));
|
||||
rooted!(in(cx) let arg0 = ObjectValue(arg0));
|
||||
rooted!(in(cx) let mut call_arg1 = UndefinedValue());
|
||||
rooted!(in(cx) let mut call_arg2 = UndefinedValue());
|
||||
let mut call_args = vec![UndefinedValue(), UndefinedValue(), ObjectValue(&**_obj)];
|
||||
let mut call_args = vec![UndefinedValue(), UndefinedValue(), ObjectValue(*_obj)];
|
||||
rooted!(in(cx) let mut ignoredReturnVal = UndefinedValue());
|
||||
for i in 0..(*this).get_iterable_length() {
|
||||
(*this).get_value_at_index(i).to_jsval(cx, call_arg1.handle_mut());
|
||||
|
|
|
@ -310,9 +310,9 @@ impl ToJSValConvertible for Reflector {
|
|||
assert!(!obj.is_null());
|
||||
let same_compartment = IsObjectInContextCompartment(obj, cx);
|
||||
if same_compartment {
|
||||
rval.set(ObjectValue(&*ToWindowProxyIfWindow(obj)));
|
||||
rval.set(ObjectValue(ToWindowProxyIfWindow(obj)));
|
||||
} else {
|
||||
rval.set(ObjectValue(&*obj));
|
||||
rval.set(ObjectValue(obj));
|
||||
|
||||
if !JS_WrapValue(cx, rval) {
|
||||
panic!("JS_WrapValue failed.");
|
||||
|
|
|
@ -105,6 +105,6 @@ impl<T: ToJSValConvertible> ToJSValConvertible for MozMap<T> {
|
|||
None));
|
||||
}
|
||||
|
||||
rval.set(ObjectValue(&*js_object.handle().get()));
|
||||
rval.set(ObjectValue(js_object.handle().get()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -178,7 +178,7 @@ pub fn ensure_expando_object(cx: *mut JSContext, obj: HandleObject) -> *mut JSOb
|
|||
expando = JS_NewObjectWithGivenProto(cx, ptr::null_mut(), HandleObject::null());
|
||||
assert!(!expando.is_null());
|
||||
|
||||
SetProxyExtra(obj.get(), JSPROXYSLOT_EXPANDO, &ObjectValue(&*expando));
|
||||
SetProxyExtra(obj.get(), JSPROXYSLOT_EXPANDO, &ObjectValue(expando));
|
||||
}
|
||||
expando
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue