Promise-backend.js fails to load on Windows if it's a symlink
Categories
(Core :: XPCOM, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox79 | --- | fixed |
People
(Reporter: saschanaz, Assigned: saschanaz)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
- Build Gecko
- Run
./mach xpcshell-test netwerk/test/unit/test_resumable_channel.js
and check it succeeds - Replace
obj-x86_64-pc-mingw32\dist\bin\modules\Promise-backend.js
with a symlink totoolkit\modules\Promise-backend.js
. - Run step 2 again
Expected: It should also succeed
Actual: It does not, the failure log says:
pid:17812 JavaScript error: resource://testing-common/PromiseTestUtils.jsm, line 70: TypeError: can't access property "Debugging", JSMPromise is undefined
Since 1) Promise.jsm
loads Promise-backend.js
via mozJSSubScriptLoader
2) Promise.jsm
itself runs as expected (try adding throw new Error
there), I think it's a problem in mozJSSubScriptLoader
.
Assignee | ||
Comment 1•5 years ago
|
||
Further debugging says NS_ReadInputStreamToString
inside mozJSSubScriptLoader::ReadScript
reads a zero-length string.
Assignee | ||
Comment 2•5 years ago
|
||
Sigh. During further digging I found that nsLocalFileWin
has a total misunderstanding of Windows symlinks. An .lnk
file is a shortcut, not a symlink.
Comment 3•5 years ago
|
||
Remember that Gecko has more than 20-years history. When nsIFile was implemented, Windows had no symlink support and Mozilla decided to treat .lnk files as symlinks.
Comment 4•5 years ago
|
||
To fix this bug, nsLocalFile::GetFileSize
should support (native NTFS) symlinks.
Comment 5•5 years ago
|
||
Unrelated to the JS engine. Moving to XPCOM based on comment 4.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 6•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Comment 8•4 years ago
|
||
bugherder |
Description
•