mirror of https://github.com/tc39/test262.git
Avoid false positive (#2375)
Prior to this patch, the modified test would pass if no exception was produced. Use the `assert.throws` utility function to concisely express the expectation more completely.
This commit is contained in:
parent
83483b7310
commit
479ea0ec0b
|
@ -23,17 +23,11 @@ Object.defineProperty(arrObj, "1", {
|
|||
configurable: true
|
||||
});
|
||||
|
||||
try {
|
||||
assert.throws(TypeError, function() {
|
||||
arrObj[1] = 4;
|
||||
} catch (e) {
|
||||
verifyEqualTo(arrObj, "1", getFunc());
|
||||
});
|
||||
verifyEqualTo(arrObj, "1", getFunc());
|
||||
|
||||
verifyNotEnumerable(arrObj, "1");
|
||||
verifyNotEnumerable(arrObj, "1");
|
||||
|
||||
verifyConfigurable(arrObj, "1");
|
||||
|
||||
if (!(e instanceof TypeError)) {
|
||||
$ERROR("Expected TypeError, got " + e);
|
||||
}
|
||||
|
||||
}
|
||||
verifyConfigurable(arrObj, "1");
|
||||
|
|
Loading…
Reference in New Issue