super-prop-arrow.js (823B)
1 // Copyright (C) 2016 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 esid: sec-scripts-static-semantics-early-errors 5 es6id: 15.1.1 6 description: > 7 A direct eval in the functon code of an ArrowFunction may not contain 8 SuperProperty 9 info: | 10 - It is a Syntax Error if StatementList Contains super unless the source code 11 containing super is eval code that is being processed by a direct eval that 12 is contained in function code that is not the function code of an 13 ArrowFunction. 14 features: [super, arrow-function] 15 ---*/ 16 17 var caught; 18 var f = () => eval('super.property;'); 19 20 try { 21 f(); 22 } catch (err) { 23 caught = err; 24 } 25 26 assert.sameValue(typeof caught, 'object'); 27 assert.sameValue(caught.constructor, SyntaxError); 28 29 reportCompare(0, 0);