-
Notifications
You must be signed in to change notification settings - Fork 69
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
Prevent backtracking above /-prefix entries #229
Conversation
Closes #207. Also changes the error message suggestion for a nearby case to be more helpful and accurate.
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.
Nice to see and this is what we implemented in Node.js as well (in addition to banning node_modules segments in the target).
@@ -6,7 +6,8 @@ | |||
"lodash-dot": "./node_modules/lodash-es/lodash.js", | |||
"lodash-dot/": "./node_modules/lodash-es/", | |||
"lodash-dotdot": "../node_modules/lodash-es/lodash.js", | |||
"lodash-dotdot/": "../node_modules/lodash-es/" | |||
"lodash-dotdot/": "../node_modules/lodash-es/", | |||
"mapped/path/": "https://github.com/WICG/import-maps/issues/207/" |
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.
Could you add an entry of "mapped/"
here, and "mapped/backtrack"
to the expectedResults
below?
This is to test that the backtracking failure at a more specific key doesn't allow fallback to less specific key -- i.e. "mapped/path/../backtrack"
can't be resolved while "mapped/backtrack"
can be resolved.
@@ -6,7 +6,8 @@ | |||
"lodash-dot": "./node_modules/lodash-es/lodash.js", | |||
"lodash-dot/": "./node_modules/lodash-es/", | |||
"lodash-dotdot": "../node_modules/lodash-es/lodash.js", | |||
"lodash-dotdot/": "../node_modules/lodash-es/" | |||
"lodash-dotdot/": "../node_modules/lodash-es/", | |||
"mapped/path/": "https://github.com/WICG/import-maps/issues/207/" | |||
} |
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.
Also, how about adding test cases for URL-like specfiers + backtracking? (perhaps in url-specifiers.json
, where URL-like specifiers + trailing slash is tested)
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.
LGTM, once the comments on tests are addressed.
Note to self: PR title is wrong; it should be |
Reflecting WICG/import-maps#229 Bug: 848607, WICG/import-maps#207 Change-Id: Id056b3fd27489ecdfe45456220fd1d8c01dc8d3f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2570012 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/master@{#833945}
Reflecting WICG/import-maps#229 Bug: 848607, WICG/import-maps#207 Change-Id: Id056b3fd27489ecdfe45456220fd1d8c01dc8d3f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2570012 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/master@{#833945} GitOrigin-RevId: 916cc2354cae22a6e8280f2a2b7ac66b30b99e67
Closes #207.
Also changes the error message suggestion for a nearby case to be more helpful and accurate.
Preview | Diff