mirror of
https://github.com/servo/servo.git
synced 2025-08-02 12:10:29 +01:00
Update mozjs to 0.14.1
This update pulls in improvements on mozjs that now removes the need to pass pointers to CompileOptionsWraper::new(), allows NewProxyObject to now accept a Singleton bool and JSClass and removes an unsafe Handle::new usage.
This commit is contained in:
parent
9e6da58d77
commit
f8c9ee4eff
7 changed files with 12 additions and 17 deletions
|
@ -2778,6 +2778,8 @@ rooted!(in(*cx) let obj = NewProxyObject(
|
|||
handler,
|
||||
Handle::from_raw(UndefinedHandleValue),
|
||||
proto.get(),
|
||||
ptr::null(),
|
||||
false,
|
||||
));
|
||||
assert!(!obj.is_null());
|
||||
SetProxyReservedSlot(
|
||||
|
|
|
@ -511,7 +511,6 @@ impl EventTarget {
|
|||
|
||||
// Step 3.9
|
||||
|
||||
let url_serialized = CString::new(handler.url.to_string()).unwrap();
|
||||
let name = CString::new(format!("on{}", &**ty)).unwrap();
|
||||
|
||||
// Step 3.9, subsection ParameterList
|
||||
|
@ -528,7 +527,7 @@ impl EventTarget {
|
|||
|
||||
let cx = window.get_cx();
|
||||
let options = unsafe {
|
||||
CompileOptionsWrapper::new(*cx, url_serialized.as_ptr(), handler.line as u32)
|
||||
CompileOptionsWrapper::new(*cx, &handler.url.to_string(), handler.line as u32)
|
||||
};
|
||||
|
||||
// Step 3.9, subsection Scope steps 1-6
|
||||
|
|
|
@ -118,7 +118,6 @@ use std::borrow::Cow;
|
|||
use std::cell::Cell;
|
||||
use std::collections::hash_map::Entry;
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
use std::ffi::CString;
|
||||
use std::mem;
|
||||
use std::ops::Index;
|
||||
use std::rc::Rc;
|
||||
|
@ -2586,7 +2585,6 @@ impl GlobalScope {
|
|||
self.time_profiler_chan().clone(),
|
||||
|| {
|
||||
let cx = self.get_cx();
|
||||
let filename = CString::new(filename).unwrap();
|
||||
|
||||
let ar = enter_realm(&*self);
|
||||
|
||||
|
@ -2597,7 +2595,7 @@ impl GlobalScope {
|
|||
match code {
|
||||
SourceCode::Text(text_code) => {
|
||||
let options =
|
||||
CompileOptionsWrapper::new(*cx, filename.as_ptr(), line_number);
|
||||
CompileOptionsWrapper::new(*cx, filename, line_number);
|
||||
|
||||
debug!("compiling dom string");
|
||||
compiled_script.set(Compile1(
|
||||
|
|
|
@ -58,7 +58,6 @@ use servo_config::pref;
|
|||
use servo_url::ImmutableOrigin;
|
||||
use servo_url::ServoUrl;
|
||||
use std::cell::Cell;
|
||||
use std::ffi::CString;
|
||||
use std::fs::{create_dir_all, read_to_string, File};
|
||||
use std::io::{Read, Seek, Write};
|
||||
use std::mem::replace;
|
||||
|
@ -424,8 +423,7 @@ impl FetchResponseListener for ClassicContext {
|
|||
let cx = global.get_cx();
|
||||
let _ar = enter_realm(&*global);
|
||||
|
||||
let final_url_c_str = CString::new(final_url.as_str()).unwrap();
|
||||
let options = unsafe { CompileOptionsWrapper::new(*cx, final_url_c_str.as_ptr(), 1) };
|
||||
let options = unsafe { CompileOptionsWrapper::new(*cx, final_url.as_str(), 1) };
|
||||
|
||||
let can_compile_off_thread = pref!(dom.script.asynch) &&
|
||||
unsafe { CanCompileOffThread(*cx, options.ptr as *const _, source_text.len()) };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue