| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Test fails for me in 3.x and passes in 4.0.0 and up, which is consistent with it detecting the bug it is designed to test, so that's good. (EDIT: Have to comment out common.js when running with Node 3.x because Node 3.x doesn't have the necessary ES6-isms. That's not a criticism or anything. Just a note for anyone else trying to do the same verification.) |
Sorry, something went wrong.
|
@Trott may be because template strings were not available before 4.x? |
Sorry, something went wrong.
|
@thefourtheye Yeah, and maybe other stuff too. I think there's at least one arrow functions in there now, for example. |
Sorry, something went wrong.
|
@Trott @thefourtheye should I rewrite this without template strings to make tests running this on old versions possible? |
Sorry, something went wrong.
|
@kthelgason Ya, since we claim that this fixes is a regression for a bug in 0.10, it would be better to be able to test it in that version. Can you please change that? |
Sorry, something went wrong.
|
@thefourtheye agreed. Fixed and pushed. |
Sorry, something went wrong.
| @@ -0,0 +1,28 @@ | |||
| /* eslint-disable strict */ | |||
There was a problem hiding this comment.
Why this is necessary?
Sorry, something went wrong.
There was a problem hiding this comment.
in strict mode running this will fail as bar is undefined until the code has been evaled. If this line is not present the build will fail linting
Sorry, something went wrong.
There was a problem hiding this comment.
it would be better to disable the no-undef rule inline
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry, I could have been clearer above, the issue here is that this code is not valid in strict mode, since eval in strict mode does not introduce new variables into the surrounding scope. Therefore this file cannot have strict mode enabled, and hence this linter rule.
Sorry, something went wrong.
There was a problem hiding this comment.
Oh I see, my bad.
Sorry, something went wrong.
|
This test ran perfectly fine in 3.x (with common.js removed) and there was no need to remove the template strings. Template strings are supported in 3.x. The problem (which should not be "fixed") was in common.js and was probably the arrow function in that file. If you want to restore the template string for better code hygiene, feel free. |
Sorry, something went wrong.
|
@Trott Ok, I still feel that there might be some value to being able to run the test under 0.10 to see the failure. |
Sorry, something went wrong.
|
@kthelgason Fair enough. I'm not opposed to the current format or anything. |
Sorry, something went wrong.
|
@Trott willing to land this or looking for more eyes on it first? |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
LGTM. CI Run: https://ci.nodejs.org/job/node-test-pull-request/1912/ |
Sorry, something went wrong.
PR-URL: #5250 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
PR-URL: #5250 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
PR-URL: #5250 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
PR-URL: #5250 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
PR-URL: #5250 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
| Back | FazBrowse Home | New Git URL |
This PR adds a regression test for the bug mentioned in #2245 where when a strict function is evaled it would not capture it's context.