fn-name-cover.js (1134B)
1 // Copyright (C) 2015 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 es6id: 12.14.4 6 description: > 7 Assignment of function `name` attribute (CoverParenthesizedExpression) 8 info: | 9 AssignmentExpression[In, Yield] : 10 LeftHandSideExpression[?Yield] = AssignmentExpression[?In, ?Yield] 11 12 1. If LeftHandSideExpression is neither an ObjectLiteral nor an 13 ArrayLiteral, then 14 [...] 15 e. If IsAnonymousFunctionDefinition(AssignmentExpression) and 16 IsIdentifierRef of LeftHandSideExpression are both true, then 17 18 i. Let hasNameProperty be HasOwnProperty(rval, "name"). 19 ii. ReturnIfAbrupt(hasNameProperty). 20 iii. If hasNameProperty is false, perform SetFunctionName(rval, 21 GetReferencedName(lref)). 22 includes: [propertyHelper.js] 23 ---*/ 24 25 var xCover, cover; 26 27 xCover = (0, function() {}); 28 cover = (function() {}); 29 30 assert(xCover.name !== 'xCover'); 31 32 verifyProperty(cover, 'name', { 33 value: 'cover', 34 writable: false, 35 enumerable: false, 36 configurable: true, 37 }); 38 39 reportCompare(0, 0);