mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1354529: Don't set constructor-flag for generator functions created through GeneratorFunction intrinsic. r=arai
This commit is contained in:
parent
b719cb0993
commit
f97c82453a
@ -1762,9 +1762,12 @@ FunctionConstructor(JSContext* cx, const CallArgs& args, GeneratorKind generator
|
||||
|
||||
// Step 25-32 (reordered).
|
||||
RootedObject globalLexical(cx, &global->lexicalEnvironment());
|
||||
JSFunction::Flags flags = (isStarGenerator || isAsync)
|
||||
? JSFunction::INTERPRETED_LAMBDA_GENERATOR_OR_ASYNC
|
||||
: JSFunction::INTERPRETED_LAMBDA;
|
||||
AllocKind allocKind = isAsync ? AllocKind::FUNCTION_EXTENDED : AllocKind::FUNCTION;
|
||||
RootedFunction fun(cx, NewFunctionWithProto(cx, nullptr, 0,
|
||||
JSFunction::INTERPRETED_LAMBDA, globalLexical,
|
||||
flags, globalLexical,
|
||||
anonymousAtom, proto,
|
||||
allocKind, TenuredObject));
|
||||
if (!fun)
|
||||
|
Loading…
Reference in New Issue
Block a user