-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
var result = [];
for (var i=0; i<2; i++) {
(function () {
var copy = i;
var func = function () {
return copy;
};
result.push(func);
}());
}
console.log(result[0]());
Flat will report Reference error while node engine does not:
$ ./flathead/bin/flat ./test.js
ReferenceError: copy is not defined
at ./test.js:6:10
at (anonymous function) in ./test.js:12:22
$ node ./test.js
0
Metadata
Metadata
Assignees
Labels
No labels