Uh oh!
There was an error while loading. Please reload this page.
test: eval a strict function - #5250
Conversation
Trott
commented
Feb 16, 2016
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 |
thefourtheye
commented
Feb 16, 2016
@Trott may be because template strings were not available before 4.x? |
Trott
commented
Feb 16, 2016
@thefourtheye Yeah, and maybe other stuff too. I think there's at least one arrow functions in there now, for example. |
kthelgason
commented
Feb 16, 2016
@Trott@thefourtheye should I rewrite this without template strings to make tests running this on old versions possible? |
thefourtheye
commented
Feb 16, 2016
@kthelgason Ya, since we claim that this |
f7ea0f9 to
cd5b3fcComparekthelgason
commented
Feb 16, 2016
@thefourtheye agreed. Fixed and pushed. |
| @@ -0,0 +1,28 @@ | |||
| /* eslint-disable strict */ | |||
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
There was a problem hiding this comment.
it would be better to disable the no-undef rule inline
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.
Trott
commented
Feb 16, 2016
This test ran perfectly fine in 3.x (with The problem (which should not be "fixed") was in If you want to restore the template string for better code hygiene, feel free. |
kthelgason
commented
Feb 16, 2016
@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. |
Trott
commented
Feb 16, 2016
@kthelgason Fair enough. I'm not opposed to the current format or anything. |
kthelgason
commented
Mar 12, 2016
@Trott willing to land this or looking for more eyes on it first? |
jasnell
commented
Mar 12, 2016
LGTM |
thefourtheye
commented
Mar 13, 2016
LGTM. CI Run: https://ci.nodejs.org/job/node-test-pull-request/1912/ |
PR-URL: #5250 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
jasnell
commented
Mar 14, 2016
Landed in 25eedf0 |
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>
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.