Created
October 26, 2016 00:35
-
-
Save zertosh/c8fd6482cde0292f363bf47dd81fb0f1 to your computer and use it in GitHub Desktop.
Atom 1.12.0-beta4 with --harmony "TypeError: Generator is already running"
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 bar() { | |
return 1; | |
} | |
async function foo() { | |
let out = await bar(); | |
return out.toString(); | |
} | |
foo(); |
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 foo = function () { | |
var _ref = _asyncToGenerator(function* () { | |
var out = yield bar(); | |
return out.toString(); | |
}); | |
return function foo() { | |
return _ref.apply(this, arguments); | |
}; | |
}(); | |
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } | |
function bar() { | |
return 1; | |
} | |
foo(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment