Created
February 20, 2018 17:30
-
-
Save mattcollier/1271484a58d5fdc623a3374242c4de30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"env": { | |
"es6": true, | |
"node": true | |
}, | |
"parserOptions": { | |
"ecmaVersion": 6 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// no error detected on line 9/10 | |
function y(callback) { | |
setTimeout(() => callback(), 0); | |
} | |
function x(a, callback) { | |
console.log('STEP 1', a); | |
y(() => { | |
console.log('STEP 2', a); | |
const {a} = () => ({a: 5}); | |
callback(null, a); | |
}); | |
} | |
x(4, (err, result) => { | |
console.log('ERROR', err); | |
console.log('RESULT', result); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// properly reports Parsing error: Identifier 'a' has already been declared on line 3 | |
function x(a, callback) { | |
console.log('STEP 1', a); | |
const {a} = () => ({a: 5}); | |
callback(null, a); | |
} | |
x(4, (err, result) => { | |
console.log('ERROR', err); | |
console.log('RESULT', result); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment