summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/class/subclass/derived-class-return-override-catch-super-arrow.js
blob: d7f4a4ef1c1ab480160bc61cbd682a30b7891a4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (C) 2021 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-ecmascript-function-objects-construct-argumentslist-newtarget
description: >
  TypeError from `return 0` is not catchable with `super` called in catch block
  from an arrow function.
---*/

class C extends class {} {
  constructor() {
    var f = () => super();

    try {
      return 0;
    } catch(e) {
      f();
    }
  }
}

assert.throws(TypeError, function() {
  new C();
});

reportCompare(0, 0);