Created
April 7, 2014 19:19
-
-
Save getify/10034276 to your computer and use it in GitHub Desktop.
bug with for-of iteration of traceur/es6fiddle?
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
var obj = { | |
_step: 0 | |
}; | |
obj[Symbol.iterator] = function() { | |
return { | |
next: function() { | |
return { value: ++obj._step, done: (obj._step === 4) }; | |
} | |
}; | |
}; | |
for (var v of obj){ | |
console.log(v); | |
} | |
// Expect: | |
// 1 | |
// 2 | |
// 3 | |
// 4 | |
// Get (via traceur and es6fiddle): | |
// 1 | |
// 2 | |
// 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment