Skip to content

Instantly share code, notes, and snippets.

@phoddie
Created December 29, 2019 02:54
Show Gist options
  • Save phoddie/05f89653b4017d63e91cb7ef4fffbf83 to your computer and use it in GitHub Desktop.
Save phoddie/05f89653b4017d63e91cb7ef4fffbf83 to your computer and use it in GitHub Desktop.
Generator and AsynGenerator prototypes - at preload and run time
import { link, test } from "test"
trace(link)
trace(test())
debugger
{
"include": "$(MODDABLE)/examples/manifest_base.json",
"modules": {
"*": [
"./main",
"./test",
]
},
"preload": [
"test",
],
}
export function test() {
const _Function = function() {}.constructor;
const _AsyncFunction = async function() {}.constructor;
const _AsyncGeneratorFunction = async function*() {}.constructor;
const _GeneratorFunction = function*() {}.constructor;
return(`
_Function == Function ${_Function == Function}
_AsyncFunction.__proto__ == Function ${_AsyncFunction.__proto__ == Function}
_AsyncGeneratorFunction.__proto__ == Function ${_AsyncGeneratorFunction.__proto__ == Function}
_GeneratorFunction.__proto__ == Function ${_GeneratorFunction.__proto__ == Function}
`);
}
export const link = test();
@phoddie
Copy link
Author

phoddie commented Dec 29, 2019

Related to tc39/ecma262#1707

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment