diff options
author | Moonchild <moonchild@palemoon.org> | 2019-12-17 21:47:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-17 21:47:18 +0000 |
commit | 07d0bcbf112a4e274905837c6ea0b0212b51e4e3 (patch) | |
tree | 3b43cb63b33d82d4965d402aca39028836983bb4 /js/src/jsfun.h | |
parent | e2de507e0261c9b138cd3cf5356c21eca3e7a28d (diff) | |
parent | 6c3e42ac6427fabaf83b5acc7877aa3d15117125 (diff) | |
download | UXP-07d0bcbf112a4e274905837c6ea0b0212b51e4e3.tar UXP-07d0bcbf112a4e274905837c6ea0b0212b51e4e3.tar.gz UXP-07d0bcbf112a4e274905837c6ea0b0212b51e4e3.tar.lz UXP-07d0bcbf112a4e274905837c6ea0b0212b51e4e3.tar.xz UXP-07d0bcbf112a4e274905837c6ea0b0212b51e4e3.zip |
Merge pull request #1327 from g4jc/async_iteration
Implement Async Iteration in SpiderMonkey
This resolves #1287
Diffstat (limited to 'js/src/jsfun.h')
-rw-r--r-- | js/src/jsfun.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/js/src/jsfun.h b/js/src/jsfun.h index 234169507..ea9e7af9b 100644 --- a/js/src/jsfun.h +++ b/js/src/jsfun.h @@ -89,15 +89,15 @@ class JSFunction : public js::NativeObject ASMJS_CTOR = ASMJS_KIND | NATIVE_CTOR, ASMJS_LAMBDA_CTOR = ASMJS_KIND | NATIVE_CTOR | LAMBDA, INTERPRETED_METHOD = INTERPRETED | METHOD_KIND, - INTERPRETED_METHOD_GENERATOR = INTERPRETED | METHOD_KIND, + INTERPRETED_METHOD_GENERATOR_OR_ASYNC = INTERPRETED | METHOD_KIND, INTERPRETED_CLASS_CONSTRUCTOR = INTERPRETED | CLASSCONSTRUCTOR_KIND | CONSTRUCTOR, INTERPRETED_GETTER = INTERPRETED | GETTER_KIND, INTERPRETED_SETTER = INTERPRETED | SETTER_KIND, INTERPRETED_LAMBDA = INTERPRETED | LAMBDA | CONSTRUCTOR, INTERPRETED_LAMBDA_ARROW = INTERPRETED | LAMBDA | ARROW_KIND, - INTERPRETED_LAMBDA_GENERATOR = INTERPRETED | LAMBDA, + INTERPRETED_LAMBDA_GENERATOR_OR_ASYNC = INTERPRETED | LAMBDA, INTERPRETED_NORMAL = INTERPRETED | CONSTRUCTOR, - INTERPRETED_GENERATOR = INTERPRETED, + INTERPRETED_GENERATOR_OR_ASYNC = INTERPRETED, NO_XDR_FLAGS = RESOLVED_LENGTH | RESOLVED_NAME, STABLE_ACROSS_CLONES = CONSTRUCTOR | HAS_GUESSED_ATOM | LAMBDA | @@ -146,7 +146,9 @@ class JSFunction : public js::NativeObject MOZ_ASSERT_IF(nonLazyScript()->funHasExtensibleScope() || nonLazyScript()->needsHomeObject() || nonLazyScript()->isDerivedClassConstructor() || - isGenerator(), + isStarGenerator() || + isLegacyGenerator() || + isAsync(), nonLazyScript()->bodyScope()->hasEnvironment()); return nonLazyScript()->bodyScope()->hasEnvironment(); @@ -501,8 +503,6 @@ class JSFunction : public js::NativeObject return js::NotGenerator; } - bool isGenerator() const { return generatorKind() != js::NotGenerator; } - bool isLegacyGenerator() const { return generatorKind() == js::LegacyGenerator; } bool isStarGenerator() const { return generatorKind() == js::StarGenerator; } @@ -513,9 +513,9 @@ class JSFunction : public js::NativeObject bool isAsync() const { if (isInterpretedLazy()) - return lazyScript()->asyncKind() == js::AsyncFunction; + return lazyScript()->isAsync(); if (hasScript()) - return nonLazyScript()->asyncKind() == js::AsyncFunction; + return nonLazyScript()->isAsync(); return false; } @@ -660,6 +660,9 @@ Generator(JSContext* cx, unsigned argc, Value* vp); extern bool AsyncFunctionConstructor(JSContext* cx, unsigned argc, Value* vp); +extern bool +AsyncGeneratorConstructor(JSContext* cx, unsigned argc, Value* vp); + // Allocate a new function backed by a JSNative. Note that by default this // creates a singleton object. extern JSFunction* |