From 02bdf77b192ed79faa5d0d839d4296a4f442f0a4 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Mon, 11 Nov 2019 12:19:14 -0500 Subject: [PATCH] Add test for AggregateError's toString Ref tc39/proposal-promise-any#49 --- test/built-ins/AggregateError/toString.js | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/built-ins/AggregateError/toString.js diff --git a/test/built-ins/AggregateError/toString.js b/test/built-ins/AggregateError/toString.js new file mode 100644 index 00000000000..482ad0403a0 --- /dev/null +++ b/test/built-ins/AggregateError/toString.js @@ -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' +);