blob: c0bc4e153dcaca0339189339a5d9ee6ea202a612 (
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
28
29
30
31
32
33
34
35
36
37
38
39
|
// 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 thrown after the function body has been left, so
an error thrown from an iterator has precedence.
---*/
var error = new Test262Error();
var iter = {
[Symbol.iterator]() {
return this;
},
next() {
return {done: false};
},
return() {
throw error;
},
};
class C extends class {} {
constructor() {
super();
for (var k of iter) {
return 0;
}
}
}
assert.throws(Test262Error, function() {
new C();
});
reportCompare(0, 0);
|