2 // Copyright (C) 2016 the V8 project authors. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
6 Default AssignmentExpression (which can be recognized as an "anonymous"
7 generator function declaration) is correctly initialized upon evaluation
8 esid: sec-moduleevaluation
11 16. Let result be the result of evaluating module.[[ECMAScriptCode]].
14 15.2.3.11 Runtime Semantics: Evaluation
16 ExportDeclaration : export default AssignmentExpression;
19 3. If IsAnonymousFunctionDefinition(AssignmentExpression) is true, then
20 a. Let hasNameProperty be ? HasOwnProperty(value, "name").
21 b. If hasNameProperty is false, perform SetFunctionName(value,
23 4. Let env be the running execution context's LexicalEnvironment.
24 5. Perform ? InitializeBoundName("*default*", value, env).
27 features: [generators]
30 export default (function* () { return 24601; });
31 import g from './eval-export-dflt-expr-gen-anon.js';
33 assert.sameValue(g().next().value, 24601, 'binding initialized');
34 assert.sameValue(g.name, 'default', 'correct name is assigned');