Support the updated spidermonkey bindings

This commit is contained in:
Michael Wu 2015-09-23 16:53:03 -04:00
parent 32daa17d5c
commit e733a7c46a
20 changed files with 234 additions and 223 deletions

View file

@ -779,9 +779,9 @@ impl<'a, T: Reflectable> ScriptHelpers for &'a T {
let _ac = JSAutoCompartment::new(cx, globalhandle.get());
let options = CompileOptionsWrapper::new(cx, filename.as_ptr(), 0);
unsafe {
if Evaluate2(cx, options.ptr, code.as_ptr() as *const i16,
code.len() as libc::size_t,
rval) == 0 {
if !Evaluate2(cx, options.ptr, code.as_ptr(),
code.len() as libc::size_t,
rval) {
debug!("error evaluating JS string");
report_pending_exception(cx, globalhandle.get());
}