__proto__-fn-name.js (852B)
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 esid: sec-runtime-semantics-propertydefinitionevaluation 6 description: Function name is not assigned based on the __proto__ property name 7 info: | 8 [...] 9 3. Else if propKey is "__proto__" and IsComputedPropertyKey of PropertyName is false, then 10 a. Let isProtoSetter be true. 11 [...] 12 5. If IsAnonymousFunctionDefinition(AssignmentExpression) is true and isProtoSetter is false, then 13 a. Let propValue be ? NamedEvaluation of AssignmentExpression with argument propKey. 14 6. Else, 15 a. Let exprValueRef be ? Evaluation of AssignmentExpression. 16 ---*/ 17 18 var o; 19 20 o = { 21 __proto__: function () {}, 22 }; 23 24 assert(Object.getPrototypeOf(o).name !== "__proto__"); 25 26 reportCompare(0, 0);