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:
André Bargull 2017-11-01 07:54:04 -07:00
parent 9d7378cdba
commit 6c8698acac
1 changed files with 6 additions and 3 deletions

View File

@ -37,15 +37,18 @@ class B {
assert.sameValue(typeof B.name, 'function');
var isDefined = false;
class C {
static get name() {
if (isDefined) {
return 'pass';
}
$ERROR('Static `get` accessor should not be executed during definition');
}
}
assert.throws(Test262Error, function() {
C.name;
});
isDefined = true;
assert.sameValue(C.name, 'pass');
class D {
static set name(_) {