mirror of
https://github.com/tc39/test262.git
synced 2025-07-26 23:44:27 +02:00
Update test to not rely on throwing a Test262Error
Only this test relied on $ERROR throwing a catchable Test262Error. This change allows test environments to provide their on $ERROR function for better error reporting.
This commit is contained in:
parent
9d7378cdba
commit
6c8698acac
@ -37,15 +37,18 @@ class B {
|
|||||||
|
|
||||||
assert.sameValue(typeof B.name, 'function');
|
assert.sameValue(typeof B.name, 'function');
|
||||||
|
|
||||||
|
var isDefined = false;
|
||||||
class C {
|
class C {
|
||||||
static get name() {
|
static get name() {
|
||||||
|
if (isDefined) {
|
||||||
|
return 'pass';
|
||||||
|
}
|
||||||
$ERROR('Static `get` accessor should not be executed during definition');
|
$ERROR('Static `get` accessor should not be executed during definition');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.throws(Test262Error, function() {
|
isDefined = true;
|
||||||
C.name;
|
assert.sameValue(C.name, 'pass');
|
||||||
});
|
|
||||||
|
|
||||||
class D {
|
class D {
|
||||||
static set name(_) {
|
static set name(_) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user