summaryrefslogtreecommitdiffstats
path: root/js/src/jsfun.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsfun.h')
-rw-r--r--js/src/jsfun.h19
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*