mirror of
https://github.com/servo/servo.git
synced 2025-08-01 11:40:30 +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::Bindings::DocumentBinding::DocumentMethods;
|
||||||
use dom::bindings::codegen::InheritTypes::EventTargetCast;
|
use dom::bindings::codegen::InheritTypes::EventTargetCast;
|
||||||
use dom::bindings::global::global_object_for_js_object;
|
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::error::Error::InvalidCharacter;
|
||||||
use dom::bindings::global::GlobalRef;
|
use dom::bindings::global::GlobalRef;
|
||||||
use dom::bindings::js::{MutNullableJS, JSRef, Temporary};
|
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,
|
code.len() as libc::c_uint,
|
||||||
filename.as_ptr(), 1, &mut rval) == 0 {
|
filename.as_ptr(), 1, &mut rval) == 0 {
|
||||||
debug!("error evaluating JS string");
|
debug!("error evaluating JS string");
|
||||||
|
report_pending_exception(cx, global);
|
||||||
}
|
}
|
||||||
rval
|
rval
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
[browsing-context-choose-parent.html]
|
[browsing-context-choose-parent.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
expected: TIMEOUT
|
||||||
|
[The parent browsing context must be chosen if the given name is '_parent']
|
||||||
|
expected: NOTRUN
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue