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

View File

@ -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(_) {