mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +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
4
tests/wpt/mozilla/tests/mozilla/resources/external.js
Normal file
4
tests/wpt/mozilla/tests/mozilla/resources/external.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
|
||||
|
||||
|
||||
this_is_a_js_error
|
|
@ -6,12 +6,18 @@
|
|||
<script>
|
||||
setup({allow_uncaught_exception:true});
|
||||
var t = async_test("error event has proper line number");
|
||||
var errors = 0;
|
||||
var expected_lines = [21, 4];
|
||||
window.addEventListener('error', t.step_func(function(e) {
|
||||
assert_true(e instanceof ErrorEvent);
|
||||
assert_equals(e.lineno, 16);
|
||||
t.done();
|
||||
assert_equals(e.lineno, expected_lines[errors]);
|
||||
errors++;
|
||||
if (errors == 2) {
|
||||
t.done();
|
||||
}
|
||||
}), true);
|
||||
</script>
|
||||
<script>
|
||||
this_is_a_js_error
|
||||
</script>
|
||||
<script src="resources/external.js"></script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue