Closed
Bug 1106337
Opened 10 years ago
Closed 10 years ago
Debugger can't find source code for script with unicode host name
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 987069
People
(Reporter: jimb, Unassigned)
References
()
Details
To reproduce:
- Visit the URL.
- Hit f12 to open the toolbox.
- Select the debugger.
In the source view area, I see the text:
Error loading source:
loadSourceError
Inspecting the document's <script> element shows the source we ought to be showing.
Comment 1•10 years ago
|
||
Likely fallout from bug 905700
Comment 2•10 years ago
|
||
In the browser console:
Got an exception during SA_onSource: Request failed with status code = 2152398878 in onStopRequest handler for url = http://dahlström.net/svg/html/get-embedded-svg-document-script.html:
fetch/streamListener.onStopRequest@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:498:29
Comment 3•10 years ago
|
||
This bug seems to have existed for a long time, actually. I just tried it on Firefox 32 and it also happens.
I just talked to Panos and he said we have a bug handling "punycode", which I've never heard of before but evidently is a real thing for unicode DNS: https://en.wikipedia.org/wiki/Punycode
Looks like we pass the URL straight into `Services.io.newChannel`, so not sure if this bug is more at the platform level or not.
Summary: Debugger can't find source code from an inline <script> element → Debugger can't find source code for script with unicode host name
D.Script.source.url gives "http://dahlström.net/svg/html/get-embedded-svg-document-script.html", while various non-debugger APIs (for the document, etc.) give the correct URL of.
Jim, any idea why D.Script.source.url would mess up string encoding?
Component: Developer Tools: Debugger → JavaScript Engine
Flags: needinfo?(jimb)
Product: Firefox → Core
(In reply to J. Ryan Stinnett [:jryans] from comment #4)
> D.Script.source.url gives
> "http://dahlström.net/svg/html/get-embedded-svg-document-script.html",
> while various non-debugger APIs (for the document, etc.) give the correct
> URL of...
"http://dahlström.net/svg/html/get-embedded-svg-document-script.html"
Comment 6•10 years ago
|
||
Because DebuggerScript_getUrl does:
str = NewStringCopyZ<CanGC>(cx, script->filename());
But NewStringCopyZ expects ISO-8859-1 input or some such nonsense, but script->filename() is UTF-8 (because it needs to be a char* but still represent all of Unicode).
Does the JS engine have something better than the LossyUTF8CharsToNewTwoByteCharsZ thing in CharacterEncoding.h to use here?
Flags: needinfo?(jorendorff)
Comment 7•10 years ago
|
||
Bah. Comment 6 is pretty much a word-for-word repeat of bug 987069 comment 1. Can we just fix this? :(
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: needinfo?(jorendorff)
Flags: needinfo?(jimb)
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•