summaryrefslogtreecommitdiffstats
path: root/js/src/jsfun.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-12-01 13:34:22 -0500
committerGaming4JC <g4jc@hyperbola.info>2019-12-17 06:25:23 -0500
commit9163aaebb670bd87e6ef71beaf24999c926217eb (patch)
tree48bc403ef6b3349b749b0c38c1e94818b0734274 /js/src/jsfun.cpp
parent1fd726c6b04faacbb49c525ec733d9419ab65a84 (diff)
downloadUXP-9163aaebb670bd87e6ef71beaf24999c926217eb.tar
UXP-9163aaebb670bd87e6ef71beaf24999c926217eb.tar.gz
UXP-9163aaebb670bd87e6ef71beaf24999c926217eb.tar.lz
UXP-9163aaebb670bd87e6ef71beaf24999c926217eb.tar.xz
UXP-9163aaebb670bd87e6ef71beaf24999c926217eb.zip
Bug 1343481 - Part 1: Remove {JSFunction,JSScript,LazyScript}.isGenerator() method.
Tag #1287
Diffstat (limited to 'js/src/jsfun.cpp')
-rw-r--r--js/src/jsfun.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp
index 9edf238ef..9d54fef78 100644
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -131,7 +131,11 @@ IsFunctionInStrictMode(JSFunction* fun)
static bool
IsNewerTypeFunction(JSFunction* fun) {
- return fun->isArrow() || fun->isGenerator() || fun->isAsync() || fun->isMethod();
+ return fun->isArrow() ||
+ fun->isStarGenerator() ||
+ fun->isLegacyGenerator() ||
+ fun->isAsync() ||
+ fun->isMethod();
}
// Beware: this function can be invoked on *any* function! That includes
@@ -442,8 +446,12 @@ fun_resolve(JSContext* cx, HandleObject obj, HandleId id, bool* resolvedp)
* - Arrow functions
* - Function.prototype
*/
- if (fun->isBuiltin() || (!fun->isConstructor() && !fun->isGenerator()))
+ if (fun->isBuiltin())
return true;
+ if (!fun->isConstructor()) {
+ if (!fun->isStarGenerator() && !fun->isLegacyGenerator() && !fun->isAsync())
+ return true;
+ }
if (!ResolveInterpretedFunctionPrototype(cx, fun, id))
return false;
@@ -1556,7 +1564,7 @@ fun_isGenerator(JSContext* cx, unsigned argc, Value* vp)
return true;
}
- args.rval().setBoolean(fun->isGenerator());
+ args.rval().setBoolean(fun->isStarGenerator() || fun->isLegacyGenerator());
return true;
}