Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/super/call-arg-evaluation-err.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-super-keyword
5 es6id: 12.3.5
6 description: Returns abrupt completion resulting from ArgumentListEvaluation
7 info: |
8 [...]
9 4. Let argList be ArgumentListEvaluation of Arguments.
10 5. ReturnIfAbrupt(argList).
11 features: [class]
12 ---*/
13
14 var thrown = new Test262Error();
15 var thrower = function() {
16 throw thrown;
17 };
18 var caught;
19 class C extends Object {
20 constructor() {
21 try {
22 super(thrower());
23 } catch (err) {
24 caught = err;
25 }
26 }
27 }
28
29 // When the "construct" invocation completes and the "this" value is
30 // uninitialized, the specification dictates that a ReferenceError must be
31 // thrown. That behavior is tested elsewhere, so the error is ignored (if it is
32 // produced at all).
33 try {
34 new C();
35 } catch (_) {}
36
37 assert.sameValue(caught, thrown);