mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Do not use the script element's line number for external scripts.
This commit is contained in:
parent
550df86ac8
commit
6f19b0cd82
3 changed files with 14 additions and 3 deletions
|
@ -510,9 +510,10 @@ impl HTMLScriptElement {
|
|||
|
||||
// Step 5.a.2.
|
||||
let window = window_from_node(self);
|
||||
let line_number = if script.external { 1 } else { self.line_number as u32 };
|
||||
rooted!(in(window.get_cx()) let mut rval = UndefinedValue());
|
||||
window.upcast::<GlobalScope>().evaluate_script_on_global_with_result(
|
||||
&script.text, script.url.as_str(), rval.handle_mut(), self.line_number as u32);
|
||||
&script.text, script.url.as_str(), rval.handle_mut(), line_number);
|
||||
|
||||
// Step 6.
|
||||
document.set_current_script(old_script.r());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue