mirror of
https://github.com/servo/servo.git
synced 2025-07-30 18:50:36 +01:00
Eagerly report errors when evaluating JS on a global scope. Fixes #4966.
This commit is contained in:
parent
172db80703
commit
880c7189b3
2 changed files with 4 additions and 1 deletions
|
@ -10,7 +10,7 @@ use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
|
|||
use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods;
|
||||
use dom::bindings::codegen::InheritTypes::EventTargetCast;
|
||||
use dom::bindings::global::global_object_for_js_object;
|
||||
use dom::bindings::error::Fallible;
|
||||
use dom::bindings::error::{report_pending_exception, Fallible};
|
||||
use dom::bindings::error::Error::InvalidCharacter;
|
||||
use dom::bindings::global::GlobalRef;
|
||||
use dom::bindings::js::{MutNullableJS, JSRef, Temporary};
|
||||
|
@ -362,6 +362,7 @@ impl<'a, T: Reflectable> ScriptHelpers for JSRef<'a, T> {
|
|||
code.len() as libc::c_uint,
|
||||
filename.as_ptr(), 1, &mut rval) == 0 {
|
||||
debug!("error evaluating JS string");
|
||||
report_pending_exception(cx, global);
|
||||
}
|
||||
rval
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue