-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Strange name-changing behaviour in console.log.bind
#2754
Comments
Appears to be new to 4.0.0
|
This is not unique to
|
Odd that it modifies the original function. |
Indeed, I think this is the crux of the problem, if there is one, for us:
that's not right, although I do appreciate the |
Interestingly enough it doesn't seem to happen outside the repl
|
The reason it messes up the other names is it breaks the naming for any bound funciton. This V8 feature appears to just be broken:
|
This issue is fixed in V8 4.6. Here is the V8 bug: https://code.google.com/p/v8/issues/detail?id=4278 |
a candidate for backporting to v4 perhaps; anybody got ideas on how this could end up being a serious bug or is it likely to simply be an annoyance? |
@rvagg the only case I've heard of this being an issue (so far) is with an APM vendor which was using |
right, that sucks, unless there's a decent workaround then I'd be +1 on backporting the fix |
This would technically affect us in some cases, even if fixed, because we were relying |
It seems as though there are some interesting interactions between binding and Running:
outputs:
Note this occurs after any call into
outputs:
|
@lykkin I can't reproduce what you're describing/showing on the master branch. |
@wraithan Ok, I was trying it from the REPL. It does indeed happen when loaded from a file. |
Original commit message: [es6] Bound function name Instead of updating the SharedFuntionInfo set the name property on the function directly. BUG=v8:4278 LOG=N [email protected], [email protected] CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1227523003 Cr-Commit-Position: refs/heads/master@{nodejs#29558} Fixes: nodejs#2754
Confirmed that @targos's backport PR #2916 fixes the issue that @lykkin brought up Input:
Output:
|
Original commit message: [es6] Bound function name Instead of updating the SharedFuntionInfo set the name property on the function directly. BUG=v8:4278 LOG=N [email protected], [email protected] CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1227523003 Cr-Commit-Position: refs/heads/master@{#29558} Fixes: #2754 PR-URL: #2916 Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Original commit message: [es6] Bound function name Instead of updating the SharedFuntionInfo set the name property on the function directly. BUG=v8:4278 LOG=N [email protected], [email protected] CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1227523003 Cr-Commit-Position: refs/heads/master@{nodejs#29558} Fixes: nodejs#2754 PR-URL: nodejs#2916 Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Fixed by d7da617 and released in v4.1.0 |
This is something I've noticed when using the latest version (
4.0.0
as of writing this), and haven't tried it in earlier versions yet.If you call
bind()
onconsole.log
, it will modify the name of the original function and also keep tacking onbound
to the name every time you call it.REPL example:
It also will modify the
name
s of the otherconsole
functions too:And this behaviour doesn't seem to show up for other functions:
The text was updated successfully, but these errors were encountered: