ident-name-method-def-function-escaped.js (1060B)
1 // This file was procedurally generated from the following sources: 2 // - src/identifier-names/function-escaped.case 3 // - src/identifier-names/default/class-expression-method-def.template 4 /*--- 5 description: function is a valid identifier name, using escape (MethodDefinition) 6 esid: prod-PropertyDefinition 7 features: [class] 8 flags: [generated] 9 info: | 10 ObjectLiteral : 11 { PropertyDefinitionList } 12 { PropertyDefinitionList , } 13 14 PropertyDefinitionList: 15 PropertyDefinition 16 PropertyDefinitionList , PropertyDefinition 17 18 PropertyDefinition: 19 MethodDefinition 20 ... 21 22 MethodDefinition: 23 PropertyName ( UniqueFormalParameters ){ FunctionBody } 24 25 PropertyName: 26 LiteralPropertyName 27 ... 28 29 LiteralPropertyName: 30 IdentifierName 31 ... 32 33 Reserved Words 34 35 A reserved word is an IdentifierName that cannot be used as an Identifier. 36 37 ---*/ 38 39 40 var C = class { 41 \u0066unction() { return 42; } 42 } 43 44 var obj = new C(); 45 46 assert.sameValue(obj['function'](), 42, 'property exists'); 47 48 reportCompare(0, 0);