Repository navigation
feat(harness-ops): bound computed keys by provenance in the parser reader #12665
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
Closed
melodic-automation-lanes
wants to merge
5
commits into
main
from
work-resolve-issue/issue-5901-41567742390-1
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4f6e66a
Resolve issue #5901
melodic-automation-lanes[bot] 70b50d1
Address review feedback on work-resolve-issue/issue-5901-41567742390-1
melodic-automation-lanes[bot] 7014fa5
Merge main into work-resolve-issue/issue-5901-41567742390-1
melodic-automation-lanes[bot] d1cfff6
Fix failing CI checks on work-resolve-issue/issue-5901-41567742390-1
melodic-automation-lanes[bot] c8ede30
chore: start the lane checks again on main's workflow files
melodic-automation-lanes[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
.changes/harness-ops/work-resolve-issue-issue-5901-41567742390-1-68615e17.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| bump: minor | ||
| --- | ||
|
|
||
| ### Added | ||
|
|
||
| - **The parser reader bounds a computed key it cannot list.** Under `--reader=parser`, in a module with an import or export or a program whose first statement is `"use strict"`, a computed read whose key can spell neither `require` nor `constructor` no longer counts as a load the parser cannot name or a read that reaches `Function`. A computed write there counts only for the trusted names its key can spell, unless it can spell `__proto__`. A `+` makes a number or a string that starts with its left side and ends with its right side, so `e[n+1]` spells neither. A template starts and ends with its own text. A parameter holds what each call passes when it is never written and its function is bound to one name, never exported, only ever called directly, and out of reach of `arguments` and block hoisting. Code that may run sloppy, including the code a `Function` call folds to, is bounded only by known values, since `f.caller` can call a function with any argument. When the parser refuses a callback held in a parameter whose function is used other than by a call, the reason now reads `the parameter's function is used other than by a call`, so it no longer matches the refusal for a returning function. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Advisory: the doc and the changelog fragment don't describe the behavior change from the round-1 fix.
maySpellAnywhereSink(parser_helper.cjs:2337) means aconstructorread is exempt as inert only when its key also can't spelleval,Function, a vm runner or__defineGetter__/__defineSetter__. An unknown key, such as afor inkey or any key in sloppy code, can spell all of them.So a discarded or tested unknown-key read is now a
function-constructorhit, in sloppy code too. Common bundle code likefor(k in o)if(o[k])used to be exempt and now counts.This paragraph still says a
constructorread that is "discarded, tested, compared…" does not count, and that "any member namedevalorFunction" counts, which reads as literal names only. The fragment says sloppy code "is bounded only by known values", which suggests its results are unchanged.It is the safe direction, but the next host run's count of
function-constructorhits will rise for a reason the doc doesn't give. Please say in this paragraph and in the fragment that a computed read whose key may spell one of those members counts wherever it stands, inert or not.claude-lane: claude-review