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 "named" class declaration is correctly initialized upon
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 ClassDeclaration
19 3. Let className be the sole element of BoundNames of ClassDeclaration.
20 4. If className is "*default*", then
21 a. Let hasNameProperty be ? HasOwnProperty(value, "name").
22 b. If hasNameProperty is false, perform SetFunctionName(value,
24 c. Let env be the running execution context's LexicalEnvironment.
25 d. Perform ? InitializeBoundName("*default*", value, env).
26 5. Return NormalCompletion(empty).
30 export default class cName { valueOf() { return 45; } }
31 import C from './eval-export-dflt-cls-named.js';
33 assert.sameValue(new C().valueOf(), 45, 'binding initialized');
34 assert.sameValue(C.name, 'cName', 'correct name is assigned');