Skip to content
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

util: fix inspecting document.all #31938

Closed
wants to merge 1 commit into from
Closed

Conversation

devsnek
Copy link
Member

@devsnek devsnek commented Feb 24, 2020

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Feb 24, 2020
@devsnek

This comment has been minimized.

Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s nice that we have an V8 API for this, but I’d really like to avoid the performance hit of the extra calls into C++ and would strongly prefer the variant you suggested in #31889 (comment)

@BridgeAR

This comment has been minimized.

@devsnek

This comment has been minimized.

@BridgeAR

This comment has been minimized.

@devsnek devsnek marked this pull request as ready for review March 10, 2020 00:37
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to mark this as <HTMLDDA> {} or [Function: <HTMLDDA>]

@devsnek
Copy link
Member Author

devsnek commented Mar 13, 2020

@BridgeAR how would i go about adding that <HTMLDDA> tag?

@devsnek
Copy link
Member Author

devsnek commented Mar 18, 2020

@BridgeAR

@BridgeAR
Copy link
Member

@devsnek adding it requires to skip the loop and to then check for undefined. If that's the case, just return the string '<HTMLDDA>'. The downside of this is, that it would not detect changed prototypes (in case someone changes it with Object.setPrototype()).
Alternatively check https://github.com/nodejs/node/pull/31938/files#diff-91f6ca3fae2551d5959872b74c18946aL495 here for typeof tmp === 'undefined' plus the detected prototype name. Return both in a string in case it's not Object and otherwise return only '<HTMLDDA>'.

@addaleax addaleax added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. util Issues and PRs related to the built-in util module. and removed lib / src Issues and PRs related to general changes in the lib or src directory. labels Mar 29, 2020
@nodejs-github-bot
Copy link
Collaborator

@addaleax
Copy link
Member

Landed in 89ae1f1

addaleax pushed a commit that referenced this pull request Mar 30, 2020
Fixes: #31889

PR-URL: #31938
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@addaleax addaleax closed this Mar 30, 2020
addaleax pushed a commit that referenced this pull request Mar 30, 2020
Fixes: #31889

PR-URL: #31938
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
targos pushed a commit that referenced this pull request Apr 22, 2020
Fixes: #31889

PR-URL: #31938
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants