doc: Add notes for using @@toStringTag#2201
doc: Add notes for using @@toStringTag#2201yosuke-furukawa wants to merge 1 commit intonodejs:masterfrom yosuke-furukawa:add_symboltag_note
Conversation
|
@yosuke-furukawa would you mind changing this to inform about this, but also center it around deprecation notices? That would be great, it's something I never got around to doing. :) Prior discussion: #1301 |
|
@Fishrock123 +1. We would be better to deprecate |
|
@yosuke-furukawa I wouldn't delay a deprecation notice in the docs for v3 (It was supposed to be in v2 so..) Besides, we'll probably need to wait a good while before we deprecate this with a run-time warning. |
|
@Fishrock123 @yosuke-furukawa ... is there reason to keep this one open? Is it still needed? If so, it needs to be updated. |
doc/api/util.markdown
Outdated
There was a problem hiding this comment.
"Note:" (capitalize) and please wrap lines at 80 columns. I'd write 'enabled with' instead of 'enabled under'.
|
LGTM when rebased and comments addressed. I think this is a valuable addition to the documentation. |
|
@yosuke-furukawa ... could I ask you to please rebase, update and address @bnoordhuis' comments. Thank you! |
|
This is mostly resolved. The |
util.isError() is the only remaining util.is*() method that depends on Object.prototype.toString() behavior. This commit notes the limitations of isError() related to @@toStringTag. Refs: nodejs#2201 PR-URL: nodejs#5414 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
I checked
util.is*functions. the following functions may be broken using ES2015 features.those functions use
Object.prototype.toString.callto check the type.But
@@toStringTagcan chage the returned value.@@toStringTagis enabled under--harmonyon io.js v2.For example,
This PR is to add a notice in these util function.