Skip to content

Commit cd3af52

Browse files
committed
servo: Merge #20246 - Use higher level handles from JS bindings (from marmistrz:test-lifetime-handles); r=jdm
…reak servo <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix servo/rust-mozjs#153 <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because this is just migration to a lifetimed API <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 914952487bcbba0a31db8aefc4a9487903721959 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 42a821264f87e446c0ea44718656b99fb2c3541c
1 parent d843563 commit cd3af52

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+403
-307
lines changed

servo/Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

servo/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ opt-level = 3
1919
# lto = false
2020

2121
[patch.crates-io]
22-
2322
# If you need to temporarily test Servo with a local fork of some upstream
2423
# crate, add that here. Use the form:
2524
#

servo/components/domobject_derive/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn expand_dom_object(input: syn::DeriveInput) -> quote::Tokens {
4040
#[allow(unsafe_code)]
4141
unsafe fn to_jsval(&self,
4242
cx: *mut ::js::jsapi::JSContext,
43-
rval: ::js::jsapi::MutableHandleValue) {
43+
rval: ::js::rust::MutableHandleValue) {
4444
let object = ::dom::bindings::reflector::DomObject::reflector(self).get_jsobject();
4545
object.to_jsval(cx, rval)
4646
}

servo/components/malloc_size_of/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ app_units = "0.6"
2323
cssparser = "0.23.0"
2424
euclid = "0.17"
2525
hashglobe = { path = "../hashglobe" }
26-
mozjs = { version = "0.5.0", features = ["promises"], optional = true }
26+
mozjs = { version = "0.6", features = ["promises"], optional = true }
2727
selectors = { path = "../selectors" }
2828
serde_bytes = { version = "0.10", optional = true }
2929
servo_arc = { path = "../servo_arc" }

servo/components/script/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ metrics = {path = "../metrics"}
6363
mitochondria = "1.1.2"
6464
mime = "0.2.1"
6565
mime_guess = "1.8.0"
66-
mozjs = { version = "0.5.0", features = ["promises"]}
66+
mozjs = { version = "0.6", features = ["promises"]}
6767
msg = {path = "../msg"}
6868
net_traits = {path = "../net_traits"}
6969
num-traits = "0.1.32"

servo/components/script/body.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ use js::jsapi::Heap;
1616
use js::jsapi::JSContext;
1717
use js::jsapi::JSObject;
1818
use js::jsapi::JS_ClearPendingException;
19-
use js::jsapi::JS_GetPendingException;
20-
use js::jsapi::JS_ParseJSON;
2119
use js::jsapi::Value as JSValue;
2220
use js::jsval::JSVal;
2321
use js::jsval::UndefinedValue;
22+
use js::rust::wrappers::JS_GetPendingException;
23+
use js::rust::wrappers::JS_ParseJSON;
2424
use js::typedarray::{ArrayBuffer, CreateWith};
2525
use mime::{Mime, TopLevel, SubLevel};
2626
use std::cell::Ref;

servo/components/script/devtools.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ use dom::globalscope::GlobalScope;
2222
use dom::node::{Node, window_from_node};
2323
use dom::window::Window;
2424
use ipc_channel::ipc::IpcSender;
25-
use js::jsapi::{JSAutoCompartment, ObjectClassName};
25+
use js::jsapi::JSAutoCompartment;
2626
use js::jsval::UndefinedValue;
27+
use js::rust::wrappers::ObjectClassName;
2728
use msg::constellation_msg::PipelineId;
2829
use script_thread::Documents;
2930
use std::ffi::CStr;

servo/components/script/dom/bindings/callback.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ use dom::bindings::root::{Dom, DomRoot};
1010
use dom::bindings::settings_stack::{AutoEntryScript, AutoIncumbentScript};
1111
use dom::bindings::utils::AsCCharPtrPtr;
1212
use dom::globalscope::GlobalScope;
13-
use js::jsapi::{Heap, MutableHandleObject};
14-
use js::jsapi::{IsCallable, JSContext, JSObject, JS_WrapObject, AddRawValueRoot};
13+
use js::jsapi::{IsCallable, JSContext, JSObject, AddRawValueRoot};
1514
use js::jsapi::{JSCompartment, JS_EnterCompartment, JS_LeaveCompartment, RemoveRawValueRoot};
15+
use js::jsapi::Heap;
1616
use js::jsapi::JSAutoCompartment;
17-
use js::jsapi::JS_GetProperty;
1817
use js::jsval::{JSVal, UndefinedValue, ObjectValue};
19-
use js::rust::Runtime;
18+
use js::rust::{MutableHandleObject, Runtime};
19+
use js::rust::wrappers::{JS_WrapObject, JS_GetProperty};
2020
use std::default::Default;
2121
use std::ffi::CString;
2222
use std::mem::drop;
@@ -206,7 +206,7 @@ impl CallbackInterface {
206206
/// Wraps the reflector for `p` into the compartment of `cx`.
207207
pub fn wrap_call_this_object<T: DomObject>(cx: *mut JSContext,
208208
p: &T,
209-
rval: MutableHandleObject) {
209+
mut rval: MutableHandleObject) {
210210
rval.set(p.reflector().get_jsobject().get());
211211
assert!(!rval.get().is_null());
212212

0 commit comments

Comments
 (0)