Chromium Code Reviews| Index: src/builtins.cc |
| diff --git a/src/builtins.cc b/src/builtins.cc |
| index 1aa886ac3e6428264c4ba99b2ab4bc14500a0ee0..28b5339bc0f3afc12f7e83e783c0b3075f8be9a7 100644 |
| --- a/src/builtins.cc |
| +++ b/src/builtins.cc |
| @@ -4503,8 +4503,17 @@ BUILTIN(GeneratorFunctionConstructor) { |
| BUILTIN(AsyncFunctionConstructor) { |
| HandleScope scope(isolate); |
| - RETURN_RESULT_OR_FAILURE( |
| - isolate, CreateDynamicFunction(isolate, args, "async function")); |
| + Handle<JSFunction> func; |
| + ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| + isolate, func, CreateDynamicFunction(isolate, args, "async function")); |
| + |
| + // Do not lazily compute eval position for AsyncFunction, as they may not be |
| + // determined after the function is resumed. |
| + Handle<Script> script = handle(Script::cast(func->shared()->script())); |
| + int position = script->GetEvalPosition(); |
| + USE(position); |
|
Dan Ehrenberg
2016/06/14 16:36:01
Should we be doing this for generators as well? Ca
|
| + |
| + return *func; |
| } |
| // ES6 section 19.4.1.1 Symbol ( [ description ] ) for the [[Call]] case. |