Created
July 9, 2015 11:57
-
-
Save Gerhut/0a5b94f81b84617ac23c to your computer and use it in GitHub Desktop.
Babel compiler bug with for..of & System.js module
This file contains hidden or 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
| function* a() { | |
| yield 1 | |
| yield 2 | |
| yield 3 | |
| } | |
| for (let b of a()) { | |
| console.log(b) | |
| } |
This file contains hidden or 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
| "use strict"; | |
| var marked0$0 = [a].map(regeneratorRuntime.mark); | |
| function a() { | |
| return regeneratorRuntime.wrap(function a$(context$1$0) { | |
| while (1) switch (context$1$0.prev = context$1$0.next) { | |
| case 0: | |
| context$1$0.next = 2; | |
| return 1; | |
| case 2: | |
| context$1$0.next = 4; | |
| return 2; | |
| case 4: | |
| context$1$0.next = 6; | |
| return 3; | |
| case 6: | |
| case "end": | |
| return context$1$0.stop(); | |
| } | |
| }, marked0$0[0], this); | |
| } | |
| var _iteratorNormalCompletion = true; | |
| var _didIteratorError = false; | |
| var _iteratorError = undefined; | |
| try { | |
| for (var _iterator = a()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | |
| var b = _step.value; | |
| console.log(b); | |
| } | |
| } catch (err) { | |
| _didIteratorError = true; | |
| _iteratorError = err; | |
| } finally { | |
| try { | |
| if (!_iteratorNormalCompletion && _iterator["return"]) { | |
| _iterator["return"](); | |
| } | |
| } finally { | |
| if (_didIteratorError) { | |
| throw _iteratorError; | |
| } | |
| } | |
| } | |
This file contains hidden or 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
| System.register([], function (_export) { | |
| "use strict"; | |
| var marked0$0, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, b; | |
| function a() { | |
| return regeneratorRuntime.wrap(function a$(context$1$0) { | |
| while (1) switch (context$1$0.prev = context$1$0.next) { | |
| case 0: | |
| context$1$0.next = 2; | |
| return 1; | |
| case 2: | |
| context$1$0.next = 4; | |
| return 2; | |
| case 4: | |
| context$1$0.next = 6; | |
| return 3; | |
| case 6: | |
| case "end": | |
| return context$1$0.stop(); | |
| } | |
| }, marked0$0[0], this); | |
| } | |
| return { | |
| setters: [], | |
| execute: function () { | |
| marked0$0 = [a].map(regeneratorRuntime.mark); | |
| _iteratorNormalCompletion = true; | |
| _didIteratorError = false; | |
| _iteratorError = undefined; | |
| try { | |
| for (_iterator; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | |
| b = _step.value; | |
| console.log(b); | |
| } | |
| } catch (err) { | |
| _didIteratorError = true; | |
| _iteratorError = err; | |
| } finally { | |
| try { | |
| if (!_iteratorNormalCompletion && _iterator["return"]) { | |
| _iterator["return"](); | |
| } | |
| } finally { | |
| if (_didIteratorError) { | |
| throw _iteratorError; | |
| } | |
| } | |
| } | |
| } | |
| }; | |
| }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment