mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +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(InitUnforgeablePropertiesOnHolder(self.descriptor, self.properties))
|
||||||
code.append(CGGeneric("""\
|
code.append(CGGeneric("""\
|
||||||
JS_SetReservedSlot(prototype.get(), DOM_PROTO_UNFORGEABLE_HOLDER_SLOT,
|
JS_SetReservedSlot(prototype.get(), DOM_PROTO_UNFORGEABLE_HOLDER_SLOT,
|
||||||
ObjectValue(&*unforgeable_holder.get()))"""))
|
ObjectValue(unforgeable_holder.get()))"""))
|
||||||
|
|
||||||
return CGList(code, "\n")
|
return CGList(code, "\n")
|
||||||
|
|
||||||
|
@ -6607,7 +6607,7 @@ class CallCallback(CallbackMethod):
|
||||||
return "aThisObj.get()"
|
return "aThisObj.get()"
|
||||||
|
|
||||||
def getCallableDecl(self):
|
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):
|
def getCallGuard(self):
|
||||||
if self.callback._treatNonObjectAsNull:
|
if self.callback._treatNonObjectAsNull:
|
||||||
|
@ -6646,7 +6646,7 @@ class CallbackOperationBase(CallbackMethod):
|
||||||
'rooted!(in(cx) let callable =\n' +
|
'rooted!(in(cx) let callable =\n' +
|
||||||
CGIndenter(
|
CGIndenter(
|
||||||
CGIfElseWrapper('isCallable',
|
CGIfElseWrapper('isCallable',
|
||||||
CGGeneric('ObjectValue(&*self.parent.callback())'),
|
CGGeneric('ObjectValue(self.parent.callback())'),
|
||||||
CGGeneric(getCallableFromProp))).define() + ');\n')
|
CGGeneric(getCallableFromProp))).define() + ');\n')
|
||||||
|
|
||||||
def getCallGuard(self):
|
def getCallGuard(self):
|
||||||
|
@ -6734,10 +6734,10 @@ class CGIterableMethodGenerator(CGGeneric):
|
||||||
throw_type_error(cx, "Argument 1 of ${ifaceName}.forEach is not callable.");
|
throw_type_error(cx, "Argument 1 of ${ifaceName}.forEach is not callable.");
|
||||||
return false;
|
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_arg1 = UndefinedValue());
|
||||||
rooted!(in(cx) let mut call_arg2 = 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());
|
rooted!(in(cx) let mut ignoredReturnVal = UndefinedValue());
|
||||||
for i in 0..(*this).get_iterable_length() {
|
for i in 0..(*this).get_iterable_length() {
|
||||||
(*this).get_value_at_index(i).to_jsval(cx, call_arg1.handle_mut());
|
(*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());
|
assert!(!obj.is_null());
|
||||||
let same_compartment = IsObjectInContextCompartment(obj, cx);
|
let same_compartment = IsObjectInContextCompartment(obj, cx);
|
||||||
if same_compartment {
|
if same_compartment {
|
||||||
rval.set(ObjectValue(&*ToWindowProxyIfWindow(obj)));
|
rval.set(ObjectValue(ToWindowProxyIfWindow(obj)));
|
||||||
} else {
|
} else {
|
||||||
rval.set(ObjectValue(&*obj));
|
rval.set(ObjectValue(obj));
|
||||||
|
|
||||||
if !JS_WrapValue(cx, rval) {
|
if !JS_WrapValue(cx, rval) {
|
||||||
panic!("JS_WrapValue failed.");
|
panic!("JS_WrapValue failed.");
|
||||||
|
|
|
@ -105,6 +105,6 @@ impl<T: ToJSValConvertible> ToJSValConvertible for MozMap<T> {
|
||||||
None));
|
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());
|
expando = JS_NewObjectWithGivenProto(cx, ptr::null_mut(), HandleObject::null());
|
||||||
assert!(!expando.is_null());
|
assert!(!expando.is_null());
|
||||||
|
|
||||||
SetProxyExtra(obj.get(), JSPROXYSLOT_EXPANDO, &ObjectValue(&*expando));
|
SetProxyExtra(obj.get(), JSPROXYSLOT_EXPANDO, &ObjectValue(expando));
|
||||||
}
|
}
|
||||||
expando
|
expando
|
||||||
}
|
}
|
||||||
|
|
|
@ -274,7 +274,7 @@ impl FileReader {
|
||||||
*result.borrow_mut() = Some(FileReaderResult::ArrayBuffer(Heap::default()));
|
*result.borrow_mut() = Some(FileReaderResult::ArrayBuffer(Heap::default()));
|
||||||
|
|
||||||
if let Some(FileReaderResult::ArrayBuffer(ref mut heap)) = *result.borrow_mut() {
|
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)]
|
#[allow(unsafe_code)]
|
||||||
unsafe fn initialize(&self, cx: *mut JSContext) {
|
unsafe fn initialize(&self, cx: *mut JSContext) {
|
||||||
let obj = self.reflector().get_jsobject();
|
let obj = self.reflector().get_jsobject();
|
||||||
self.permanent_js_root.set(ObjectValue(&**obj));
|
self.permanent_js_root.set(ObjectValue(*obj));
|
||||||
assert!(AddRawValueRoot(cx,
|
assert!(AddRawValueRoot(cx,
|
||||||
self.permanent_js_root.get_unsafe(),
|
self.permanent_js_root.get_unsafe(),
|
||||||
b"Promise::root\0" as *const _ as *const _));
|
b"Promise::root\0" as *const _ as *const _));
|
||||||
|
@ -278,7 +278,7 @@ fn create_native_handler_function(cx: *mut JSContext,
|
||||||
assert!(!obj.is_null());
|
assert!(!obj.is_null());
|
||||||
SetFunctionNativeReserved(obj.get(),
|
SetFunctionNativeReserved(obj.get(),
|
||||||
SLOT_NATIVEHANDLER,
|
SLOT_NATIVEHANDLER,
|
||||||
&ObjectValue(&**holder));
|
&ObjectValue(*holder));
|
||||||
SetFunctionNativeReserved(obj.get(),
|
SetFunctionNativeReserved(obj.get(),
|
||||||
SLOT_NATIVEHANDLER_TASK,
|
SLOT_NATIVEHANDLER_TASK,
|
||||||
&Int32Value(task as i32));
|
&Int32Value(task as i32));
|
||||||
|
|
2
components/servo/Cargo.lock
generated
2
components/servo/Cargo.lock
generated
|
@ -1098,7 +1098,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js"
|
name = "js"
|
||||||
version = "0.1.3"
|
version = "0.1.3"
|
||||||
source = "git+https://github.com/servo/rust-mozjs#fc380e0e7700f3179a86e8261eafe0828532bbfe"
|
source = "git+https://github.com/servo/rust-mozjs#14cd66c0a3e8377cad30b9ba3fe71fe394607629"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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)",
|
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
2
ports/cef/Cargo.lock
generated
2
ports/cef/Cargo.lock
generated
|
@ -1005,7 +1005,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js"
|
name = "js"
|
||||||
version = "0.1.3"
|
version = "0.1.3"
|
||||||
source = "git+https://github.com/servo/rust-mozjs#fc380e0e7700f3179a86e8261eafe0828532bbfe"
|
source = "git+https://github.com/servo/rust-mozjs#14cd66c0a3e8377cad30b9ba3fe71fe394607629"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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)",
|
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue