Created
May 20, 2019 10:12
-
-
Save stomita/ee85766b49b75bc3c2e932455cc08a59 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
Show hidden characters
{ | |
"presets": [ | |
["@babel/env", { | |
"targets": { "esmodules": true } | |
}] | |
] | |
} |
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
"use strict"; | |
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } | |
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } | |
class A { | |
foo() { | |
return _asyncToGenerator(function* () { | |
console.log('A#foo'); | |
})(); | |
} | |
} | |
class B extends A { | |
foo() { | |
var _superprop_callFoo = function _superprop_callFoo() { | |
return _superprop_callFoo(...arguments); | |
}; | |
return _asyncToGenerator(function* () { | |
console.log('B#foo'); | |
_superprop_callFoo(); | |
})(); | |
} | |
} | |
new B().foo(); |
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
class A { | |
async foo() { | |
console.log('A#foo'); | |
} | |
} | |
class B extends A { | |
async foo() { | |
console.log('B#foo'); | |
super.foo(); | |
} | |
} | |
new B().foo(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment