aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/globalscope.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-01-11 18:11:52 -0800
committerGitHub <noreply@github.com>2017-01-11 18:11:52 -0800
commiteb72c0ec7bc1e3547aa09fbe2ad800310f42989b (patch)
tree2f242cc83e6c4e60ab0a9c6234cdabfa58ffcfa8 /components/script/dom/globalscope.rs
parent6447a9783892d6ed585cf75b056ef81f0aba504c (diff)
parentdb2082bc6e0edc0028f287d4acc203e7c3bc829f (diff)
downloadservo-eb72c0ec7bc1e3547aa09fbe2ad800310f42989b.tar.gz
servo-eb72c0ec7bc1e3547aa09fbe2ad800310f42989b.zip
Auto merge of #14963 - jdm:script_current_line, r=asajeffrey
Report meaningful line numbers for inline script errors Rebased from #14661. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #12744 and partially #9604 - [X] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14963) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/globalscope.rs')
-rw-r--r--components/script/dom/globalscope.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs
index fca829c9904..4203d0e724c 100644
--- a/components/script/dom/globalscope.rs
+++ b/components/script/dom/globalscope.rs
@@ -339,13 +339,13 @@ impl GlobalScope {
/// Evaluate JS code on this global scope.
pub fn evaluate_js_on_global_with_result(
&self, code: &str, rval: MutableHandleValue) {
- self.evaluate_script_on_global_with_result(code, "", rval)
+ self.evaluate_script_on_global_with_result(code, "", rval, 1)
}
/// Evaluate a JS script on this global scope.
#[allow(unsafe_code)]
pub fn evaluate_script_on_global_with_result(
- &self, code: &str, filename: &str, rval: MutableHandleValue) {
+ &self, code: &str, filename: &str, rval: MutableHandleValue, line_number: u32) {
let metadata = time::TimerMetadata {
url: if filename.is_empty() {
self.get_url().as_str().into()
@@ -367,7 +367,7 @@ impl GlobalScope {
let _ac = JSAutoCompartment::new(cx, globalhandle.get());
let _aes = AutoEntryScript::new(self);
- let options = CompileOptionsWrapper::new(cx, filename.as_ptr(), 1);
+ let options = CompileOptionsWrapper::new(cx, filename.as_ptr(), line_number);
unsafe {
if !Evaluate2(cx, options.ptr, code.as_ptr(),
code.len() as libc::size_t,