summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/class/subclass/derived-class-return-override-catch-super.js
blob: 6497f86914567e50d279150d7068d049619665e2 (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
// 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` in catch block.
---*/

class C extends class {} {
  constructor() {
    try {
      return 0;
    } catch(e) {
      super();
    }
  }
}

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

reportCompare(0, 0);