aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2015-02-20 20:33:09 -0500
committerJosh Matthews <josh@joshmatthews.net>2015-02-23 22:28:06 -0500
commit880c7189b34e0d4504da36eb406d14fbc58580b6 (patch)
treea00ac6a5a967cd543bf8971bd9fd6093933faa2e /components/script
parent172db80703fc19ff078f2f46fb299cadd99a483b (diff)
downloadservo-880c7189b34e0d4504da36eb406d14fbc58580b6.tar.gz
servo-880c7189b34e0d4504da36eb406d14fbc58580b6.zip
Eagerly report errors when evaluating JS on a global scope. Fixes #4966.
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/window.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index fcc56776c8d..d26ef42babb 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -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
}