mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update to SpiderMonkey 66.
This commit is contained in:
parent
d0d3401361
commit
4328713f71
31 changed files with 150 additions and 144 deletions
|
@ -42,11 +42,11 @@ use dom_struct::dom_struct;
|
|||
use ipc_channel::ipc::IpcSender;
|
||||
use js::glue::{IsWrapper, UnwrapObject};
|
||||
use js::jsapi::JSObject;
|
||||
use js::jsapi::{CurrentGlobalOrNull, GetGlobalForObjectCrossCompartment};
|
||||
use js::jsapi::{CurrentGlobalOrNull, GetNonCCWObjectGlobal};
|
||||
use js::jsapi::{HandleObject, Heap};
|
||||
use js::jsapi::{JSAutoCompartment, JSContext};
|
||||
use js::jsapi::{JSAutoRealm, JSContext};
|
||||
use js::panic::maybe_resume_unwind;
|
||||
use js::rust::wrappers::Evaluate2;
|
||||
use js::rust::wrappers::EvaluateUtf8;
|
||||
use js::rust::{get_object_class, CompileOptionsWrapper, ParentRuntime, Runtime};
|
||||
use js::rust::{HandleValue, MutableHandleValue};
|
||||
use js::{JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL};
|
||||
|
@ -230,7 +230,7 @@ impl GlobalScope {
|
|||
#[allow(unsafe_code)]
|
||||
pub unsafe fn from_object(obj: *mut JSObject) -> DomRoot<Self> {
|
||||
assert!(!obj.is_null());
|
||||
let global = GetGlobalForObjectCrossCompartment(obj);
|
||||
let global = GetNonCCWObjectGlobal(obj);
|
||||
global_scope_from_global(global)
|
||||
}
|
||||
|
||||
|
@ -540,19 +540,18 @@ impl GlobalScope {
|
|||
|| {
|
||||
let cx = self.get_cx();
|
||||
let globalhandle = self.reflector().get_jsobject();
|
||||
let code: Vec<u16> = code.encode_utf16().collect();
|
||||
let filename = CString::new(filename).unwrap();
|
||||
|
||||
let _ac = JSAutoCompartment::new(cx, globalhandle.get());
|
||||
let _ac = JSAutoRealm::new(cx, globalhandle.get());
|
||||
let _aes = AutoEntryScript::new(self);
|
||||
let options = CompileOptionsWrapper::new(cx, filename.as_ptr(), line_number);
|
||||
|
||||
debug!("evaluating Dom string");
|
||||
let result = unsafe {
|
||||
Evaluate2(
|
||||
EvaluateUtf8(
|
||||
cx,
|
||||
options.ptr,
|
||||
code.as_ptr(),
|
||||
code.as_ptr() as *const _,
|
||||
code.len() as libc::size_t,
|
||||
rval,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue