forked from tc39/test262
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for AggregateError's toString
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (C) 2019 Leo Balter. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: > | ||
Instance reuses the toString from Error.prototype | ||
esid: sec-aggregate-error | ||
info: | | ||
Ref https://github.com/tc39/proposal-promise-any/pull/49 | ||
Properties of the AggregateError Constructor | ||
- has a [[Prototype]] internal slot whose value is the intrinsic object %Error%. | ||
features: [AggregateError] | ||
---*/ | ||
|
||
assert.sameValue( | ||
AggregateError.prototype.toString, | ||
Error.prototype.toString, | ||
'AggregateError inherits the toString method from Error.prototype' | ||
); | ||
|
||
var sample = new AggregateError([], ''); | ||
|
||
assert.sameValue( | ||
sample.toString, | ||
Error.prototype.toString, | ||
'toString is inherited from Error.prototype' | ||
); |