mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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
|
||||
}
|
||||
|
|
|
@ -274,7 +274,7 @@ impl FileReader {
|
|||
*result.borrow_mut() = Some(FileReaderResult::ArrayBuffer(Heap::default()));
|
||||
|
||||
if let Some(FileReaderResult::ArrayBuffer(ref mut heap)) = *result.borrow_mut() {
|
||||
heap.set(jsval::ObjectValue(&*array_buffer.get()));
|
||||
heap.set(jsval::ObjectValue(array_buffer.get()));
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ impl PromiseHelper for Rc<Promise> {
|
|||
#[allow(unsafe_code)]
|
||||
unsafe fn initialize(&self, cx: *mut JSContext) {
|
||||
let obj = self.reflector().get_jsobject();
|
||||
self.permanent_js_root.set(ObjectValue(&**obj));
|
||||
self.permanent_js_root.set(ObjectValue(*obj));
|
||||
assert!(AddRawValueRoot(cx,
|
||||
self.permanent_js_root.get_unsafe(),
|
||||
b"Promise::root\0" as *const _ as *const _));
|
||||
|
@ -278,7 +278,7 @@ fn create_native_handler_function(cx: *mut JSContext,
|
|||
assert!(!obj.is_null());
|
||||
SetFunctionNativeReserved(obj.get(),
|
||||
SLOT_NATIVEHANDLER,
|
||||
&ObjectValue(&**holder));
|
||||
&ObjectValue(*holder));
|
||||
SetFunctionNativeReserved(obj.get(),
|
||||
SLOT_NATIVEHANDLER_TASK,
|
||||
&Int32Value(task as i32));
|
||||
|
|
2
components/servo/Cargo.lock
generated
2
components/servo/Cargo.lock
generated
|
@ -1098,7 +1098,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "js"
|
||||
version = "0.1.3"
|
||||
source = "git+https://github.com/servo/rust-mozjs#fc380e0e7700f3179a86e8261eafe0828532bbfe"
|
||||
source = "git+https://github.com/servo/rust-mozjs#14cd66c0a3e8377cad30b9ba3fe71fe394607629"
|
||||
dependencies = [
|
||||
"cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue