util: add prototype support for boxed primitives#27351
Closed
BridgeAR wants to merge 1 commit intonodejs:masterfrom
Closed
util: add prototype support for boxed primitives#27351BridgeAR wants to merge 1 commit intonodejs:masterfrom
BridgeAR wants to merge 1 commit intonodejs:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
Member
Author
|
@nodejs/util PTAL |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This makes sure manipulated prototypes from boxed primitives will be highlighted. It also makes sure that a potential `Symbol.toStringTag` is taken into account.
2d7d167 to
21656b1
Compare
This comment has been minimized.
This comment has been minimized.
jdalton
reviewed
Apr 25, 2019
| { value: 'Foobar' } | ||
| ) | ||
| ), | ||
| '[Number (Array): -0] [Foobar]' |
jdalton
approved these changes
Apr 25, 2019
antsmartian
reviewed
Apr 25, 2019
| let base = `[${type}`; | ||
| if (type !== constructor) { | ||
| if (constructor === null) { | ||
| base += ' (null prototype)'; |
Contributor
There was a problem hiding this comment.
nit: Not a blocking comment.. But my thoughts..For objects, null prototype is showed as [Object: null prototype] {}, looks like for primitives, we show as [Boolean (null prototype): true] (like in test), may be we can show like [Boolean: null prototype] true, so that reading is consistent.
Member
Author
There was a problem hiding this comment.
I thought about that as well but I think it would be less obvious that it's a boxed primitive in that case (obviously, e.g., 5 is a number, so it might also just stand for extra information?).
The inconsistency is not ideal but this is likely going to be a super rare case anyway.
Collaborator
BridgeAR
added a commit
to BridgeAR/node
that referenced
this pull request
Apr 26, 2019
This makes sure manipulated prototypes from boxed primitives will be highlighted. It also makes sure that a potential `Symbol.toStringTag` is taken into account. PR-URL: nodejs#27351 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Member
Author
|
Landed in 55147d7. |
targos
pushed a commit
that referenced
this pull request
Apr 27, 2019
This makes sure manipulated prototypes from boxed primitives will be highlighted. It also makes sure that a potential `Symbol.toStringTag` is taken into account. PR-URL: #27351 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This makes sure manipulated prototypes from boxed primitives will
be highlighted. It also makes sure that a potential
Symbol.toStringTagis taken into account.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes