Closed
Bug 982153
Opened 9 years ago
Closed 9 years ago
Wrong stack frame lines for scripts dynamically injected using <script> element
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla36
People
(Reporter: Honza, Assigned: simon.lindholm10)
Details
Attachments
(1 file, 1 obsolete file)
2.95 KB,
patch
|
simon.lindholm10
:
review+
|
Details | Diff | Splinter Review |
Stack frame lines are wrong (should be +1) for script that are dynamically created using <script> element and textContent as follows: var scriptTag = document.createElement("script"); scriptTag.textContent = "console.log('hello world');"; document.body.appendChild(scriptTag); Note that line numbers are correct when <script> tag with valid src attribute is appended to the document as follows: var scriptTag = document.createElement("script"); scriptTag.src = my-file-url.js"; document.body.appendChild(scriptTag); --- It might be caused by the fact that script.startLine is set to 0 Note that script.startLine is set to 1 for other dynamically created scripts: - new Function - eval - Appending <script> element to the document (with valid src attribute) - event handlers Honza
Reporter | ||
Comment 1•9 years ago
|
||
Or should I rather use DOM: Core & HTML component? Honza
Assignee | ||
Comment 2•9 years ago
|
||
A try run suggests no further changes necessary: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=ad8321fcb698 (Being completely new to this I'm not sure if there are any other tests relevant to run.) FWIW Chrome also has 1-indexed line numbers, so I don't expect this to break anything external.
Attachment #8509853 -
Flags: review?(bzbarsky)
![]() |
||
Comment 3•9 years ago
|
||
Comment on attachment 8509853 [details] [diff] [review] Give dynamically created script elements 1-indexed line numbers. v1 Please move this bug to the appropriate Core component. There used to be a time when "0" meant "we have no idea, please don't show line numbers here at all because they'll just be lies", but apparently someone broke that at some point and started showing the bogus numbers. :( r=me given that.
Attachment #8509853 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Updated•9 years ago
|
Component: Developer Tools: Debugger → DOM: Core & HTML
Product: Firefox → Core
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 5•9 years ago
|
||
Backed out for Windows-only mochitest-1 crashes (I know, right?). https://hg.mozilla.org/integration/mozilla-inbound/rev/ed7562a016fa https://treeherder.mozilla.org/ui/logviewer.html#?job_id=3251743&repo=mozilla-inbound
Assignee | ||
Comment 6•9 years ago
|
||
... oh. So this is due to me being a complete beginner at this: the "run-if = os == 'linux'" line affects the test before it, not after. New try-run: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=7d8fd041d79a
Comment 7•9 years ago
|
||
Yes, that syntax is crazy. You're not the first one to make the mistake.
Assignee | ||
Comment 8•9 years ago
|
||
Attachment #8509853 -
Attachment is obsolete: true
Attachment #8510553 -
Flags: review+
Comment 10•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/dd1811e791ad
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/dd1811e791ad
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in
before you can comment on or make changes to this bug.
Description
•