| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
LGTM One thing we might want to consider while moving forward with block scoping is that we don't need to use IIFEs. The changes in this PR could just be wrapped in curly braces and create a new block scope. |
Sorry, something went wrong.
Sorry, something went wrong.
|
@silverwind It is already supported in strict mode. |
Sorry, something went wrong.
|
Oh, I never knew, thanks! |
Sorry, something went wrong.
|
@silverwind I think it's just part of the definition of block scope. It works at least back to io.js v1.0.0. |
Sorry, something went wrong.
|
So called standalone blocks seem to have been around since JavaScript 1.0 according to MDN. It's the combination of strict mode creating a scope on them and block scoped vars that makes them useful now. |
Sorry, something went wrong.
`test-assert.js` redeclares a variable with `var`. This change converts it to a `const` declaration and wraps it in a standalone block to scope it to just the test that uses it.
|
I sure like the idea of not having the creation of a function as unnecessary overhead. Converted to block scope, force pushed, looks good. |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
`test-assert.js` redeclares a variable with `var`. This change converts it to a `const` declaration and wraps it in a standalone block to scope it to just the test that uses it. PR-URL: nodejs#4854 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
`test-assert.js` redeclares a variable with `var`. This change converts it to a `const` declaration and wraps it in a standalone block to scope it to just the test that uses it. PR-URL: #4854 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
`test-assert.js` redeclares a variable with `var`. This change converts it to a `const` declaration and wraps it in a standalone block to scope it to just the test that uses it. PR-URL: nodejs#4854 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
|
Added the lts-watch-v4.x label. For commits like this, getting them on the lts-watch list for v4.x helps significantly when determining which commits need to be cherry picked. We cherry pick almost all the test commits unless they specifically relate to semver-minor/major updates. |
Sorry, something went wrong.
`test-assert.js` redeclares a variable with `var`. This change converts it to a `const` declaration and wraps it in a standalone block to scope it to just the test that uses it. PR-URL: #4854 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
`test-assert.js` redeclares a variable with `var`. This change converts it to a `const` declaration and wraps it in a standalone block to scope it to just the test that uses it. PR-URL: #4854 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
`test-assert.js` redeclares a variable with `var`. This change converts it to a `const` declaration and wraps it in a standalone block to scope it to just the test that uses it. PR-URL: #4854 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
`test-assert.js` redeclares a variable with `var`. This change converts it to a `const` declaration and wraps it in a standalone block to scope it to just the test that uses it. PR-URL: #4854 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
`test-assert.js` redeclares a variable with `var`. This change converts it to a `const` declaration and wraps it in a standalone block to scope it to just the test that uses it. PR-URL: nodejs#4854 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
| Back | FazBrowse Home | New Git URL |
test-assert.js redeclares a variable with var. This change converts
it to a const declaration and wraps it in an IIFE to scope it to just
the test that uses it.