Fix errors

This commit is contained in:
sagudev 2021-03-12 16:26:27 +01:00
parent 05d5eff26c
commit 425057c432
4 changed files with 11 additions and 20 deletions

View file

@ -29,7 +29,7 @@ use js::rust::wrappers::JS_FireOnNewGlobalObject;
use js::rust::wrappers::RUST_SYMBOL_TO_JSID;
use js::rust::wrappers::{JS_DefineProperty, JS_DefineProperty5};
use js::rust::wrappers::{JS_DefineProperty3, JS_DefineProperty4, JS_DefinePropertyById5};
use js::rust::wrappers::{JS_LinkConstructorAndPrototype, JS_NewObjectWithUniqueType};
use js::rust::wrappers::{JS_LinkConstructorAndPrototype, JS_NewObjectWithGivenProto};
use js::rust::{define_methods, define_properties, get_object_class};
use js::rust::{HandleObject, HandleValue, MutableHandleObject, RealmOptions};
use std::convert::TryFrom;
@ -316,7 +316,7 @@ pub fn create_object(
mut rval: MutableHandleObject,
) {
unsafe {
rval.set(JS_NewObjectWithUniqueType(*cx, class, proto));
rval.set(JS_NewObjectWithGivenProto(*cx, class, proto));
}
assert!(!rval.is_null());
define_guarded_methods(cx, rval.handle(), methods, global);

View file

@ -66,7 +66,6 @@ use std::io::{Read, Seek, Write};
use std::mem::replace;
use std::path::PathBuf;
use std::process::Command;
use std::ptr;
use std::rc::Rc;
use std::sync::{Arc, Mutex};
use style::str::{StaticStringVec, HTML_SPACE_CHARACTERS};
@ -446,16 +445,14 @@ impl FetchResponseListener for ClassicContext {
fetch_options: self.fetch_options.clone(),
});
let mut token = ptr::null_mut();
unsafe {
assert!(CompileOffThread1(
assert!(!CompileOffThread1(
*cx,
options.ptr as *const _,
&mut transform_str_to_source_text(&context.script_text) as *mut _,
Some(off_thread_compilation_callback),
Box::into_raw(context) as *mut c_void,
&mut token,
));
).is_null());
}
} else {
let load = ScriptOrigin::external(