-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
url: support LF, CR and TAB in pathToFileURL #23720
Conversation
this should wait on the resolution of the whatwg issue right? |
@devsnek Resolving the WHATWG issue would allow to have the fix out-of-the box, but I am not sure how long it will take to fix this issue and have it land on Node. Once resolved, my changes wouldn't be necessary anymore and can be reverted in a future commit to simplify the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we could tackle the root cause here, so please lets continue to track that, but the temporary fix looks good.
CI is failing on windows because it internally uses Is there a way to get the drive letter for the tests? I think it depends on cwd. |
Something like this maybe? path.parse(process.cwd()).root If you find you actually want path.parse(__dirname).root That will return process.cwd().split(path.sep)[0]
// ...or..
__dirname.split(path.sep)[0] |
Old CI results have been wiped, so a new CI although I still expect Windows to fail: https://ci.nodejs.org/job/node-test-pull-request/18797/ @demurgos Are you still intending to finish this up? Or would you prefer someone else take on the test adjustments? |
No surprise, but still failing on Windows: 23:57:43 not ok 487 parallel/test-url-pathtofileurl
23:57:43 ---
23:57:43 duration_ms: 0.221
23:57:43 severity: fail
23:57:43 exitcode: 1
23:57:43 stack: |-
23:57:43 assert.js:86
23:57:43 throw new AssertionError(obj);
23:57:43 ^
23:57:43
23:57:43 AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
23:57:43 + actual - expected
23:57:43
23:57:43 + 'file:///c:/foobar.mjs'
23:57:43 - 'file:///foobar.mjs'
23:57:43 ^
23:57:43 at Object.<anonymous> (c:\workspace\node-test-binary-windows\test\parallel\test-url-pathtofileurl.js:68:12)
23:57:43 at Module._compile (internal/modules/cjs/loader.js:722:30)
23:57:43 at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
23:57:43 at Module.load (internal/modules/cjs/loader.js:620:32)
23:57:43 at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
23:57:43 at Function.Module._load (internal/modules/cjs/loader.js:552:3)
23:57:43 at Function.Module.runMain (internal/modules/cjs/loader.js:775:12)
23:57:43 at startup (internal/bootstrap/node.js:300:19)
23:57:43 at bootstrapNodeJSCore (internal/bootstrap/node.js:826:3)
23:57:43 ... |
Agreed it would be good to get this in regardless of which way the WhatWG decision goes. |
I was away for some time. I'll rebase the PR and fix the Windows issue. I'll use separate test-cases for windows because the resolution logic differs a lot. |
cd33cec
to
98c141f
Compare
98c141f
to
ce6a0e0
Compare
@Trott The following error is thrown: Could you also start a full CI? |
CI: https://ci.nodejs.org/job/node-test-pull-request/18993/ (Currently backlogged so if you get a 404 and it's been less than an hour since I posted this here, please be patient. It should appear once another job somewhere finishes.) |
CI is green and all other requirements are met, but there were some changes pushed (to accommodate Windows) since the last review. Can one or two folks re-review/reaffirm that this still looks good to them? @BridgeAR @guybedford @TimothyGu @jasnell |
@Trott |
Fixes: nodejs#23696 PR-URL: nodejs#23720 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Landed in ef0c178. Thanks for the contribution! 🎉 |
added the semver-minor label. Feel free to remove if inaccurate |
Fixes: #23696 PR-URL: #23720 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Notable Changes: * console,util: * `console` functions now handle symbols as defined in the spec. #23708 * The inspection `depth` default is now back at 2. #24326 * dgram,net: * Added ipv6Only option for `net` and `dgram`. #23798 * http: * Chosing between the http parser is now possible per runtime flag. #24739 * readline: * The `readline` module now supports async iterators. #23916 * repl: * The multiline history feature is removed. #24804 * tls: * Added min/max protocol version options. #24405 * The X.509 public key info now includes the RSA bit size and the elliptic curve. #24358 * url: * `pathToFileURL()` now supports LF, CR and TAB. #23720 * Windows: * Tools are not installed using Boxstarter anymore. #24677 * The install-tools scripts or now included in the dist. #24233 * Added new collaborator: * [antsmartian](https://github.com/antsmartian) - Anto Aravinth. #24655 PR-URL: #24854
Fixes: #23696 PR-URL: #23720 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Fixes: #23696 PR-URL: #23720 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Notable Changes: * console,util: * `console` functions now handle symbols as defined in the spec. #23708 * The inspection `depth` default is now back at 2. #24326 * dgram,net: * Added ipv6Only option for `net` and `dgram`. #23798 * http: * Chosing between the http parser is now possible per runtime flag. #24739 * readline: * The `readline` module now supports async iterators. #23916 * repl: * The multiline history feature is removed. #24804 * tls: * Added min/max protocol version options. #24405 * The X.509 public key info now includes the RSA bit size and the elliptic curve. #24358 * url: * `pathToFileURL()` now supports LF, CR and TAB. #23720 * Windows: * Tools are not installed using Boxstarter anymore. #24677 * The install-tools scripts or now included in the dist. #24233 * Added new collaborator: * [antsmartian](https://github.com/antsmartian) - Anto Aravinth. #24655 PR-URL: #24854
Notable Changes: * console,util: * `console` functions now handle symbols as defined in the spec. #23708 * The inspection `depth` default is now back at 2. #24326 * dgram,net: * Added ipv6Only option for `net` and `dgram`. #23798 * http: * Chosing between the http parser is now possible per runtime flag. #24739 * readline: * The `readline` module now supports async iterators. #23916 * repl: * The multiline history feature is removed. #24804 * tls: * Added min/max protocol version options. #24405 * The X.509 public key info now includes the RSA bit size and the elliptic curve. #24358 * url: * `pathToFileURL()` now supports LF, CR and TAB. #23720 * Windows: * Tools are not installed using Boxstarter anymore. #24677 * The install-tools scripts or now included in the dist. #24233 * Added new collaborator: * [antsmartian](https://github.com/antsmartian) - Anto Aravinth. #24655 PR-URL: #24854
Fixes: nodejs#23696 PR-URL: nodejs#23720 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Notable Changes: * console,util: * `console` functions now handle symbols as defined in the spec. nodejs#23708 * The inspection `depth` default is now back at 2. nodejs#24326 * dgram,net: * Added ipv6Only option for `net` and `dgram`. nodejs#23798 * http: * Chosing between the http parser is now possible per runtime flag. nodejs#24739 * readline: * The `readline` module now supports async iterators. nodejs#23916 * repl: * The multiline history feature is removed. nodejs#24804 * tls: * Added min/max protocol version options. nodejs#24405 * The X.509 public key info now includes the RSA bit size and the elliptic curve. nodejs#24358 * url: * `pathToFileURL()` now supports LF, CR and TAB. nodejs#23720 * Windows: * Tools are not installed using Boxstarter anymore. nodejs#24677 * The install-tools scripts or now included in the dist. nodejs#24233 * Added new collaborator: * [antsmartian](https://github.com/antsmartian) - Anto Aravinth. nodejs#24655 PR-URL: nodejs#24854
Fixes: #23696 PR-URL: #23720 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Fixes: #23696
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes