Debian Codegraph @

js/src/tests/test262/language/eval-code/direct/super-prop.js

raw
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: A direct eval in global code may not contain SuperProperty
7 info: |
8 - It is a Syntax Error if StatementList Contains super unless the source code
9 containing super is eval code that is being processed by a direct eval that
10 is contained in function code that is not the function code of an
11 ArrowFunction.
12 features: [super]
13 ---*/
14
15 var caught;
16
17 try {
18 eval('super.property;');
19 } catch (err) {
20 caught = err;
21 }
22
23 assert.sameValue(typeof caught, 'object');
24 assert.sameValue(caught.constructor, SyntaxError);
25
26 reportCompare(0, 0);