Initial ES modules support
This commit is contained in:
@@ -13,8 +13,10 @@
|
||||
// Not supported yet: `throw()` on a generator, and `finally` blocks in
|
||||
// `return()`, which need exceptions
|
||||
|
||||
import { __is_promise, __reject, __resolve } from "jsrt:promise";
|
||||
|
||||
// A generator's object is `co` itself
|
||||
const __GeneratorProto = {
|
||||
export const __GeneratorProto = {
|
||||
// The body runs up to its `initial_yield`, after its params
|
||||
start() {
|
||||
this.step(undefined);
|
||||
@@ -39,7 +41,7 @@ const __GeneratorProto = {
|
||||
// An async fn returns a promise, which its return fulfils. A rejected await
|
||||
// rejects it, and the rest of the body does not run, as an uncaught throw at the
|
||||
// await would
|
||||
const __AsyncProto = {
|
||||
export const __AsyncProto = {
|
||||
// The body runs up to its first await, in the call
|
||||
start() {
|
||||
const promise = new Promise(undefined);
|
||||
|
||||
Reference in New Issue
Block a user