-
Notifications
You must be signed in to change notification settings - Fork 1.8k
javascript: Add support for document.defaultView in global variable references
#20844
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
base: main
Are you sure you want to change the base?
javascript: Add support for document.defaultView in global variable references
#20844
Conversation
… references Updated the data flow analysis to include `document.defaultView` as a source node for global variable references. Added a new test file `tst4.js` and updated existing tests to verify the inclusion of `defaultView` and its properties in the expected results.
76637a9 to
bd18e86
Compare
…ropertyRead Changed the method for accessing `defaultView` from `getAPropertyReference` to `getAPropertyRead` to improve accuracy in data flow analysis for global variable references.
asgerf
left a comment
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.
Looks great! Thanks for the PR. I've started an internal evaluation of the changes and will merge if it loosk good
|
|
||
| ### Minor Analysis Improvements | ||
|
|
||
| - JavaScript `DataFlow::globalVarRef` now recognizes `document.defaultView` as an alias of `window`, allowing flows such as `document.defaultView.history.pushState(...)` to be modeled and found by queries relying on `globalVarRef("history")`. |
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.
Sorry, I overlooked that this change note is in the wrong file. Files in the released directory are auto-generated during the release process.
Could you move this one directory up and rename it to 2025-11-19-default-view.md, and replace the headings with the preamble:
---
category: minorAnalysis
---
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.
hey, no problem, done, moved to lib/change-notes/2025-11-19-default-view.md ****
Introduced a new change note detailing that `DataFlow::globalVarRef` now recognizes `document.defaultView` as an alias of `window`, enhancing the modeling of data flows involving `history` in queries.
|
The |
c35d65f to
91451b7
Compare
Updated the data flow analysis to include
document.defaultViewas a source node for global variable references. Added a new test filetst4.jsand updated existing tests to verify the inclusion ofdefaultViewand its properties in the expected results.would close this #20823