diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-12-13 21:29:23 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-12-17 06:25:27 -0500 |
commit | d5086ac3aa308bb1ef177834366eeaf7b39bb17e (patch) | |
tree | 9b2c84158cf996b388bcb191130a5062fd7d6992 /js/src/vm/GlobalObject.h | |
parent | 82f9efff935a4ac4379bdfddddc84aae84fc869e (diff) | |
download | UXP-d5086ac3aa308bb1ef177834366eeaf7b39bb17e.tar UXP-d5086ac3aa308bb1ef177834366eeaf7b39bb17e.tar.gz UXP-d5086ac3aa308bb1ef177834366eeaf7b39bb17e.tar.lz UXP-d5086ac3aa308bb1ef177834366eeaf7b39bb17e.tar.xz UXP-d5086ac3aa308bb1ef177834366eeaf7b39bb17e.zip |
Bug 1331092 - Part 2: Implement Async Generator except yield*.
Tag #1287
Diffstat (limited to 'js/src/vm/GlobalObject.h')
-rw-r--r-- | js/src/vm/GlobalObject.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/js/src/vm/GlobalObject.h b/js/src/vm/GlobalObject.h index dd3f23151..ce802daba 100644 --- a/js/src/vm/GlobalObject.h +++ b/js/src/vm/GlobalObject.h @@ -100,6 +100,10 @@ class GlobalObject : public NativeObject STAR_GENERATOR_FUNCTION, ASYNC_FUNCTION_PROTO, ASYNC_FUNCTION, + ASYNC_ITERATOR_PROTO, + ASYNC_GENERATOR, + ASYNC_GENERATOR_FUNCTION, + ASYNC_GENERATOR_PROTO, MAP_ITERATOR_PROTO, SET_ITERATOR_PROTO, COLLATOR_PROTO, @@ -624,6 +628,30 @@ class GlobalObject : public NativeObject return getOrCreateObject(cx, global, ASYNC_FUNCTION, initAsyncFunction); } + static NativeObject* + getOrCreateAsyncIteratorPrototype(JSContext* cx, Handle<GlobalObject*> global) + { + return MaybeNativeObject(getOrCreateObject(cx, global, ASYNC_ITERATOR_PROTO, + initAsyncGenerators)); + } + + static NativeObject* + getOrCreateAsyncGenerator(JSContext* cx, Handle<GlobalObject*> global) { + return MaybeNativeObject(getOrCreateObject(cx, global, ASYNC_GENERATOR, + initAsyncGenerators)); + } + + static JSObject* + getOrCreateAsyncGeneratorFunction(JSContext* cx, Handle<GlobalObject*> global) { + return getOrCreateObject(cx, global, ASYNC_GENERATOR_FUNCTION, initAsyncGenerators); + } + + static NativeObject* + getOrCreateAsyncGeneratorPrototype(JSContext* cx, Handle<GlobalObject*> global) { + return MaybeNativeObject(getOrCreateObject(cx, global, ASYNC_GENERATOR_PROTO, + initAsyncGenerators)); + } + static JSObject* getOrCreateMapIteratorPrototype(JSContext* cx, Handle<GlobalObject*> global) { return getOrCreateObject(cx, global, MAP_ITERATOR_PROTO, initMapIteratorProto); @@ -782,6 +810,8 @@ class GlobalObject : public NativeObject static bool initAsyncFunction(JSContext* cx, Handle<GlobalObject*> global); + static bool initAsyncGenerators(JSContext* cx, Handle<GlobalObject*> global); + // Implemented in builtin/MapObject.cpp. static bool initMapIteratorProto(JSContext* cx, Handle<GlobalObject*> global); static bool initSetIteratorProto(JSContext* cx, Handle<GlobalObject*> global); |