mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Allow for implementation-defined Error properties
Various implementations (JSC, V8, SM) define additional properties on Error instances. Adjust the test case to account for that.
This commit is contained in:
parent
ce7e72d210
commit
f5bf9fdf2d
@ -31,7 +31,14 @@ const e = new SuppressedError(error, suppressed, message);
|
||||
|
||||
assert.sameValue(messageStringified, true);
|
||||
const keys = Object.getOwnPropertyNames(e);
|
||||
assert(keys.indexOf("message") === 0, "Expected 'message' to be defined first");
|
||||
assert(keys.indexOf("error") === 1, "Expected 'error' to be defined second");
|
||||
assert(keys.indexOf("suppressed") === 2, "Expected 'suppressed' to be defined third");
|
||||
|
||||
// Allow implementation-defined properties before "message" and after "suppressed".
|
||||
|
||||
const messageIndex = keys.indexOf("message");
|
||||
assert.notSameValue(messageIndex, -1, "Expected 'message' to be defined");
|
||||
|
||||
const errorIndex = keys.indexOf("error");
|
||||
assert.sameValue(errorIndex, messageIndex + 1, "Expected 'error' to be defined after 'message'");
|
||||
|
||||
const suppressedIndex = keys.indexOf("suppressed");
|
||||
assert.sameValue(suppressedIndex, errorIndex + 1, "Expected 'suppressed' to be defined after 'error'");
|
||||
|
Loading…
x
Reference in New Issue
Block a user