Uh oh!
There was an error while loading. Please reload this page.
util: inspect boxed symbols like other primitives - #7641
Closed
addaleax wants to merge 1 commit into
Closed
Conversation
Inspect boxed symbol objects in the same way other boxed primitives are inspected. Fixes: nodejs#7639
targos
commented
Jul 10, 2016
Member
LGTM |
3 similar comments
bnoordhuis
commented
Jul 10, 2016
Member
LGTM |
benjamingr
commented
Jul 10, 2016
Member
LGTM |
cjihrig
commented
Jul 11, 2016
Contributor
LGTM |
| // test boxed primitives output the correct values | ||
| assert.equal(util.inspect(new String('test')), '[String: \'test\']'); | ||
| assert.equal(util.inspect(Object(Symbol('test'))), '[Symbol: Symbol(test)]'); |
Contributor
There was a problem hiding this comment.
Doesn't this look like having redundant information?
Member
There was a problem hiding this comment.
No, IMO. It conveys that it's a symbol wrapped in an object; i.e., that typeof object === 'object' but that typeof object.valueOf() === 'symbol'.
MemberAuthor
There was a problem hiding this comment.
@thefourtheye I think learning the difference between Symbol(test) and [Symbol: test] might be a bit harder for people new to symbols.
This way might not be perfect, but I think the consistency with how other boxed values are displayed makes it easier to reason about what exactly is being displayed.
addaleax
commented
Jul 17, 2016
MemberAuthor
Landed in 35e8c94 |
addaleax added a commit
that referenced
this pull request
Jul 17, 2016
Inspect boxed symbol objects in the same way other boxed primitives are inspected. Fixes: #7639 PR-URL: #7641 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
evanlucas pushed a commit
that referenced
this pull request
Jul 19, 2016
Inspect boxed symbol objects in the same way other boxed primitives are inspected. Fixes: #7639 PR-URL: #7641 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
evanlucas pushed a commit
that referenced
this pull request
Jul 20, 2016
Inspect boxed symbol objects in the same way other boxed primitives are inspected. Fixes: #7639 PR-URL: #7641 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
evanlucas added a commit
that referenced
this pull request
Jul 21, 2016
Notable changes: * **buffer**: * Improve performance of Buffer.from(str, 'hex') and Buffer#write(str, 'hex'). (Christopher Jeffrey) #7602 * Fix creating from zero-length ArrayBuffer. (Ingvar Stepanyan) #7176 * **deps**: Upgrade to V8 5.0.71.xx. (Ben Noordhuis) #7531 * **repl**: Fix issue with function redeclaration. (Prince J Wesley) #7794 * **util**: Fix inspecting of boxed symbols. (Anna Henningsen) #7641 PR-URL: #7782
evanlucas added a commit
that referenced
this pull request
Jul 21, 2016
Notable changes: * **buffer**: * Improve performance of Buffer.from(str, 'hex') and Buffer#write(str, 'hex'). (Christopher Jeffrey) #7602 * Fix creating from zero-length ArrayBuffer. (Ingvar Stepanyan) #7176 * **deps**: * Upgrade to V8 5.0.71.xx. (Ben Noordhuis) #7531 * Backport V8 instanceof bugfix (Franziska Hinkelmann) #7638 * **repl**: Fix issue with function redeclaration. (Prince J Wesley) #7794 * **util**: Fix inspecting of boxed symbols. (Anna Henningsen) #7641 PR-URL: #7782
evanlucas added a commit
that referenced
this pull request
Jul 21, 2016
Notable changes: * **buffer**: * Improve performance of Buffer.from(str, 'hex') and Buffer#write(str, 'hex'). (Christopher Jeffrey) #7602 * Fix creating from zero-length ArrayBuffer. (Ingvar Stepanyan) #7176 * **deps**: * Upgrade to V8 5.0.71.xx. (Ben Noordhuis) #7531 * Backport V8 instanceof bugfix (Franziska Hinkelmann) #7638 * **repl**: Fix issue with function redeclaration. (Prince J Wesley) #7794 * **util**: Fix inspecting of boxed symbols. (Anna Henningsen) #7641 PR-URL: #7782
lukesampson pushed a commit
to ScoopInstaller/Scoop
that referenced
this pull request
Jul 24, 2016
### Notable changes * **buffer**: * Improve performance of Buffer.from(str, 'hex') and Buffer#write(str, 'hex'). (Christopher Jeffrey) [#7602](nodejs/node#7602) * Fix creating from zero-length ArrayBuffer. (Ingvar Stepanyan) [#7176](nodejs/node#7176) * **deps**: * Upgrade to V8 5.0.71.xx. (Ben Noordhuis) [#7531](nodejs/node#7531) * Backport V8 instanceof bugfix (Franziska Hinkelmann) [#7638](nodejs/node#7638) * **repl**: Fix issue with function redeclaration. (Prince J Wesley) [#7794](nodejs/node#7794) * **util**: Fix inspecting of boxed symbols. (Anna Henningsen) [#7641](nodejs/node#7641)
MylesBorins pushed a commit
that referenced
this pull request
Aug 30, 2016
Inspect boxed symbol objects in the same way other boxed primitives are inspected. Fixes: #7639 PR-URL: #7641 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
MylesBorins pushed a commit
that referenced
this pull request
Sep 28, 2016
Inspect boxed symbol objects in the same way other boxed primitives are inspected. Fixes: #7639 PR-URL: #7641 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
rvagg pushed a commit
that referenced
this pull request
Oct 18, 2016
Inspect boxed symbol objects in the same way other boxed primitives are inspected. Fixes: #7639 PR-URL: #7641 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
MylesBorins pushed a commit
that referenced
this pull request
Oct 26, 2016
Inspect boxed symbol objects in the same way other boxed primitives are inspected. Fixes: #7639 PR-URL: #7641 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Closed
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 freeto 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.
Checklist
make -j4 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
util
Description of change
Inspect boxed symbol objects in the same way other boxed primitives are inspected.
Fixes: #7639
CI: https://ci.nodejs.org/job/node-test-commit/4039/