You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
(function() {}).toString() yields different results in node 10.0.0 vs node 9 #20459
This difference seems insignificant, but it affects several critical NPM modules. One example is: promisify-node, here's a relevant issue that I created in that repo: nodegit/promisify-node#28
Of course, this means that many other NPM repos are being affected, such as: nodegit. Here's the issue I created for them: nodegit/nodegit#1490
Within the other affected modules, we have: nodegit-promise, asap, fbjs, eslint-plugin-react, and so on and so forth.
See #20355 for some previous context … I guess if it turns out that the ecosystem impact is too large, we may want to look into amending this language feature change.
@devsnek that is true, but this issue is relevant to many packages. At least we can help the authors and other developers know what's causing their builds to fail, and how to aid in the solution to this problem.
To provide some balance to the current feedback, I should mention that this change also can be an improvement for some packages. With jsdom, it means that we can better match other browsers (and continue to do so with Chrome), where we've previously failed some tests due to differences in the expected function-to-string results.
Reacted by Daniel Rodríguez, snek and Domenic Denicola
@sadasant - I see different inputs resulting in different outputs. No surprise there. Perhaps the "Here's what happens" section should include 4 inputs and outputs starting with --
Just as a quick data point - I’m one of the core contributors to the Unexpected project which is an extensible assertion framework and we have also been affected.
While we already used a regex when we inspect functions this caught us out as well and it needed a modification - we will get a fix out shortly.
So, Node 10.0.0 is fully filled in, but Node 9.5.0 is not, so dependent projects don't quite know what's changed, nor therefore what to fix or look for in their code.
Edited to fill in missing 9.3.0 outputs (thanks, @nmain) --
Seems like this can be closed at this point. I don't think there's any plans to change the behavior in 10.x etc. If I'm wrong, by all means, re-open. Closing for now. Thanks.
Activity
addaleax commentedon May 1, 2018
See #20355 for some previous context … I guess if it turns out that the ecosystem impact is too large, we may want to look into amending this language feature change.
@nodejs/v8
devsnek commentedon May 1, 2018
dupe of #20355
the new output is something any proper regex should catch anyway, the bug you linked is a bug without this change.
sadasant commentedon May 1, 2018
@devsnek that is true, but this issue is relevant to many packages. At least we can help the authors and other developers know what's causing their builds to fail, and how to aid in the solution to this problem.
Zirro commentedon May 2, 2018
To provide some balance to the current feedback, I should mention that this change also can be an improvement for some packages. With jsdom, it means that we can better match other browsers (and continue to do so with Chrome), where we've previously failed some tests due to differences in the expected function-to-string results.
sadasant commentedon May 2, 2018
Thank you @Zirro 🙌
TallTed commentedon May 2, 2018
@sadasant - I see different inputs resulting in different outputs. No surprise there. Perhaps the "Here's what happens" section should include 4 inputs and outputs starting with --
10.0.0:
(function () { }).toString()results in:'function () { }'.9.5.0:
(function () { }).toString()results in:?10.0.0:
(function(){ }).toString()results in:?.9.5.0:
(function(){ }).toString()results in:'function (){ }'.bricss commentedon May 2, 2018
This is what I have in Node 10, and truly believe that this is 100% is right result:
alexjeffburke commentedon May 2, 2018
Just as a quick data point - I’m one of the core contributors to the Unexpected project which is an extensible assertion framework and we have also been affected.
While we already used a regex when we inspect functions this caught us out as well and it needed a modification - we will get a fix out shortly.
TallTed commentedon May 3, 2018
So, Node 10.0.0 is fully filled in, but Node 9.5.0 is not, so dependent projects don't quite know what's changed, nor therefore what to fix or look for in their code.
Edited to fill in missing 9.3.0 outputs (thanks, @nmain) --
(function(){ }).toString()function(){ }function (){ }(function(){}).toString()function(){}function (){}(function (){ }).toString()function (){ }function (){ }(function (){}).toString()function (){}function (){}nmain commentedon May 4, 2018
@TallTed
TallTed commentedon May 4, 2018
Thanks, @nmain. Filled in my earlier table.
sadasant commentedon May 7, 2018
@TallTed the documentation change you mentioned sounds good!
@alexjeffburke thank you! Keep up the good work!
Trott commentedon Oct 26, 2018
Seems like this can be closed at this point. I don't think there's any plans to change the behavior in 10.x etc. If I'm wrong, by all means, re-open. Closing for now. Thanks.