diff --git a/test/built-ins/AggregateError/prototype/toString/get-message-abrupt.js b/test/built-ins/AggregateError/prototype/toString/get-message-abrupt.js deleted file mode 100644 index b70c907e449..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/get-message-abrupt.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - Gets the Object message, returning abrupt completion -info: | - AggregateError.prototype.toString ( ) - - ... - 5. Let msg be ? Get(O, "message"). - 6. If msg is undefined, set msg to the empty String; otherwise set msg to ? ToString(msg). - 7. If name is the empty String, return msg. - 8. If msg is the empty String, return name. - 9. Return the string-concatenation of name, the code unit 0x003A (COLON), the code unit 0x0020 (SPACE) and msg. -features: [AggregateError] ----*/ - -var method = AggregateError.prototype.toString; - -var called = 0; -var nameCalled = 0; -var obj = { - get name() { - nameCalled += 1; - }, - get message() { - called += 1; - throw new Test262Error(); - } -}; - -assert.throws(Test262Error, () => { - method.call(obj); -}); - -assert.sameValue(called, 1); -assert.sameValue(nameCalled, 1); diff --git a/test/built-ins/AggregateError/prototype/toString/get-message-empty-string.js b/test/built-ins/AggregateError/prototype/toString/get-message-empty-string.js deleted file mode 100644 index 3aebaeb05c5..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/get-message-empty-string.js +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - If message value is the empty string, return name -info: | - AggregateError.prototype.toString ( ) - - 1. Let O be the this value. - 2. If Type(O) is not Object, throw a TypeError exception. - 3. Let name be ? Get(O, "name"). - 4. If name is undefined, set name to "AggregateError"; otherwise set name to ? ToString(name). - 5. Let msg be ? Get(O, "message"). - 6. If msg is undefined, set msg to the empty String; otherwise set msg to ? ToString(msg). - 7. If name is the empty String, return msg. - 8. If msg is the empty String, return name. - 9. Return the string-concatenation of name, the code unit 0x003A (COLON), the code unit 0x0020 (SPACE) and msg. -features: [AggregateError] ----*/ - -var method = AggregateError.prototype.toString; - -var result = method.call({ - name: 'the name', - message: '', -}); - -assert.sameValue(result, 'the name', 'explicit from own property'); - -result = false; -result = method.call(Object.create({ - name: 'the name', - message: '', -})); - -assert.sameValue(result, 'the name', 'explicit from prototype'); - -result = false; -result = method.call({ - name: 'the name', - message: undefined, -}); - -assert.sameValue(result, 'the name', 'message is undefined'); - -result = false; -result = method.call({ - name: 'the name!', - message: { toString() { return ''; } }, -}); - -assert.sameValue(result, 'the name!', 'return name'); diff --git a/test/built-ins/AggregateError/prototype/toString/get-message-toString-object.js b/test/built-ins/AggregateError/prototype/toString/get-message-toString-object.js deleted file mode 100644 index c6de5b6ecbe..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/get-message-toString-object.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - ToString on the message object value -info: | - AggregateError.prototype.toString ( ) - - 1. Let O be the this value. - 2. If Type(O) is not Object, throw a TypeError exception. - 3. Let name be ? Get(O, "name"). - 4. If name is undefined, set name to "AggregateError"; otherwise set name to ? ToString(name). - 5. Let msg be ? Get(O, "message"). - 6. If msg is undefined, set msg to the empty String; otherwise set msg to ? ToString(msg). - 7. If name is the empty String, return msg. - 8. If msg is the empty String, return name. - 9. Return the string-concatenation of name, the code unit 0x003A (COLON), the code unit 0x0020 (SPACE) and msg. -features: [AggregateError, Symbol.toPrimitive] ----*/ - -var method = AggregateError.prototype.toString; - -var called = 0; -var obj = { - message: { - [Symbol.toPrimitive]() { - called += 1; - return 'from @@toPrimitive'; - }, - toString() { - throw new Test262Error(); - }, - valueOf() { - throw new Test262Error(); - }, - }, - name: '', -}; - -var result = method.call(obj); - -assert.sameValue(called, 1); -assert.sameValue(result, 'from @@toPrimitive'); - -called = 0; -obj = { - message: { - [Symbol.toPrimitive]: undefined, - toString() { - called += 1; - return 'from the toString method'; - }, - valueOf() { - throw new Test262Error(); - }, - }, - name: '', -}; -result = false; - -result = method.call(obj); -assert.sameValue(called, 1); -assert.sameValue(result, 'from the toString method'); - -called = 0; -obj = { - message: { - [Symbol.toPrimitive]: undefined, - toString: undefined, - valueOf() { - called += 1; - return 'from the valueOf method'; - }, - }, - name: '', -}; -result = false; - -result = method.call(obj); -assert.sameValue(called, 1); -assert.sameValue(result, 'from the valueOf method'); diff --git a/test/built-ins/AggregateError/prototype/toString/get-message-toString-symbol.js b/test/built-ins/AggregateError/prototype/toString/get-message-toString-symbol.js deleted file mode 100644 index 2e8302a929f..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/get-message-toString-symbol.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - ToString(Symbol msg) -info: | - AggregateError.prototype.toString ( ) - - 1. Let O be the this value. - 2. If Type(O) is not Object, throw a TypeError exception. - 3. Let name be ? Get(O, "name"). - 4. If name is undefined, set name to "AggregateError"; otherwise set name to ? ToString(name). - 5. Let msg be ? Get(O, "message"). - 6. If msg is undefined, set msg to the empty String; otherwise set msg to ? ToString(msg). - 7. If name is the empty String, return msg. - 8. If msg is the empty String, return name. - 9. Return the string-concatenation of name, the code unit 0x003A (COLON), the code unit 0x0020 (SPACE) and msg. -features: [AggregateError, Symbol] ----*/ - -var method = AggregateError.prototype.toString; - -var obj = { name: '', message: Symbol() }; - -assert.throws(TypeError, function() { - method.call(obj); -}, 'own property'); - -obj = Object.create({ name: '', message: Symbol() }); - -assert.throws(TypeError, function() { - method.call(obj); -}, 'from prototype'); diff --git a/test/built-ins/AggregateError/prototype/toString/get-message-toString-undefined.js b/test/built-ins/AggregateError/prototype/toString/get-message-toString-undefined.js deleted file mode 100644 index 0dfb914fad6..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/get-message-toString-undefined.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - ToString(msg) where it can return "undefined" -info: | - AggregateError.prototype.toString ( ) - - 1. Let O be the this value. - 2. If Type(O) is not Object, throw a TypeError exception. - 3. Let name be ? Get(O, "name"). - 4. If name is undefined, set name to "AggregateError"; otherwise set name to ? ToString(name). - 5. Let msg be ? Get(O, "message"). - 6. If msg is undefined, set msg to the empty String; otherwise set msg to ? ToString(msg). - 7. If name is the empty String, return msg. - 8. If msg is the empty String, return name. - 9. Return the string-concatenation of name, the code unit 0x003A (COLON), the code unit 0x0020 (SPACE) and msg. -features: [AggregateError] ----*/ - -var method = AggregateError.prototype.toString; - -var obj = { - message: { - toString() { - return undefined; - } - }, - name: 'hi', -}; - -assert.sameValue(method.call(obj), 'hi\u003A\u0020undefined', 'with name'); - -obj.name = ''; - -assert.sameValue(method.call(obj), 'undefined', 'without name'); diff --git a/test/built-ins/AggregateError/prototype/toString/get-message-toString.js b/test/built-ins/AggregateError/prototype/toString/get-message-toString.js deleted file mode 100644 index c65c8a34bb6..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/get-message-toString.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - ToString(message) -info: | - AggregateError.prototype.toString ( ) - - 1. Let O be the this value. - 2. If Type(O) is not Object, throw a TypeError exception. - 3. Let name be ? Get(O, "name"). - 4. If name is undefined, set name to "AggregateError"; otherwise set name to ? ToString(name). - 5. Let msg be ? Get(O, "message"). - 6. If msg is undefined, set msg to the empty String; otherwise set msg to ? ToString(msg). - 7. If name is the empty String, return msg. - 8. If msg is the empty String, return name. - 9. Return the string-concatenation of name, the code unit 0x003A (COLON), the code unit 0x0020 (SPACE) and msg. -features: [AggregateError] ----*/ - -var method = AggregateError.prototype.toString; - -var obj = { name: '' }; - -obj.message = 0; -assert.sameValue(method.call(obj), '0', 'Number 0'); -obj.message = null; -assert.sameValue(method.call(obj), 'null', 'null'); -obj.message = false; -assert.sameValue(method.call(obj), 'false', 'false'); -obj.message = true; -assert.sameValue(method.call(obj), 'true', 'true'); -obj.message = 1; -assert.sameValue(method.call(obj), '1', 'Number 1'); diff --git a/test/built-ins/AggregateError/prototype/toString/get-message-undefined.js b/test/built-ins/AggregateError/prototype/toString/get-message-undefined.js deleted file mode 100644 index c708cc97062..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/get-message-undefined.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - An undefined message property value is cast to 'AggregateError' -info: | - AggregateError.prototype.toString ( ) - - 1. Let O be the this value. - 2. If Type(O) is not Object, throw a TypeError exception. - 3. Let name be ? Get(O, "name"). - 4. If name is undefined, set name to "AggregateError"; otherwise set name to ? ToString(name). - 5. Let msg be ? Get(O, "message"). - 6. If msg is undefined, set msg to the empty String; otherwise set msg to ? ToString(msg). - 7. If name is the empty String, return msg. - 8. If msg is the empty String, return name. - 9. Return the string-concatenation of name, the code unit 0x003A (COLON), the code unit 0x0020 (SPACE) and msg. -features: [AggregateError] ----*/ - -var method = AggregateError.prototype.toString; - -var result = method.call({ - message: undefined, -}); - -assert.sameValue(result, 'AggregateError', 'explicit from own property'); - -result = false; -result = method.call({}); - -assert.sameValue(result, 'AggregateError', 'implicit'); - -result = false; -result = method.call(Object.create({ - message: undefined, -})); - -assert.sameValue(result, 'AggregateError', 'explicit from prototype'); - -result = false; -result = method.call({ - message: undefined, - name: 'a name', -}); - -assert.sameValue(result, 'a name', 'explicit from own property, name is set'); - -result = false; -result = method.call({ - name: 'a name', -}); - -assert.sameValue(result, 'a name', 'implicit, name is set'); - -result = false; -result = method.call(Object.create({ - message: undefined, - name: 'a name', -})); - -assert.sameValue(result, 'a name', 'explicit from prototype, name is set'); diff --git a/test/built-ins/AggregateError/prototype/toString/get-message.js b/test/built-ins/AggregateError/prototype/toString/get-message.js deleted file mode 100644 index 07cb270c1f0..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/get-message.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - Gets the Object message -info: | - AggregateError.prototype.toString ( ) - - ... - 5. Let msg be ? Get(O, "message"). - ... -features: [AggregateError] ----*/ - -var method = AggregateError.prototype.toString; - -var called = 0; -var nameCalled = 0; -var obj = { - get name() { - nameCalled += 1; - }, - get message() { - called += 1; - } -}; - -method.call(obj); - -assert.sameValue(nameCalled, 1); -assert.sameValue(called, 1); diff --git a/test/built-ins/AggregateError/prototype/toString/get-name-abrupt.js b/test/built-ins/AggregateError/prototype/toString/get-name-abrupt.js deleted file mode 100644 index de8a27551c3..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/get-name-abrupt.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - Gets the Object name, returning abrupt completion -info: | - AggregateError.prototype.toString ( ) - - 1. Let O be the this value. - 2. If Type(O) is not Object, throw a TypeError exception. - 3. Let name be ? Get(O, "name"). - 4. If name is undefined, set name to "AggregateError"; otherwise set name to ? ToString(name). - ... -features: [AggregateError] ----*/ - -var method = AggregateError.prototype.toString; - -var called = 0; -var obj = { - get name() { - called += 1; - throw new Test262Error(); - } -}; - -assert.throws(Test262Error, () => { - method.call(obj); -}); - -assert.sameValue(called, 1); diff --git a/test/built-ins/AggregateError/prototype/toString/get-name-empty-string.js b/test/built-ins/AggregateError/prototype/toString/get-name-empty-string.js deleted file mode 100644 index 22a9391bfad..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/get-name-empty-string.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - If name value is the empty string, return msg -info: | - AggregateError.prototype.toString ( ) - - 1. Let O be the this value. - 2. If Type(O) is not Object, throw a TypeError exception. - 3. Let name be ? Get(O, "name"). - 4. If name is undefined, set name to "AggregateError"; otherwise set name to ? ToString(name). - 5. Let msg be ? Get(O, "message"). - 6. If msg is undefined, set msg to the empty String; otherwise set msg to ? ToString(msg). - 7. If name is the empty String, return msg. - 8. If msg is the empty String, return name. - 9. Return the string-concatenation of name, the code unit 0x003A (COLON), the code unit 0x0020 (SPACE) and msg. -features: [AggregateError] ----*/ - -var method = AggregateError.prototype.toString; - -var result = method.call({ - name: '', - message: 'the message', -}); - -assert.sameValue(result, 'the message', 'explicit from own property'); - -result = false; -result = method.call(Object.create({ - name: '', - message: 'the message', -})); - -assert.sameValue(result, 'the message', 'explicit from prototype'); - -result = false; -result = method.call({ - name: '', - message: '', -}); - -assert.sameValue(result, '', 'both name and msg are the empty string'); - -result = false; -result = method.call({ - name: '', - message: undefined, -}); - -assert.sameValue(result, 'message', 'return msg'); - -result = false; -result = method.call({ - name: { toString() { return ''; } }, - message: 'the message!', -}); - -assert.sameValue(result, 'the message!', 'own name property is cast to an empty string'); - -result = false; -result = method.call(Object.create({ - name: { toString() { return ''; } }, - message: 'the message!', -})); - -assert.sameValue(result, 'the message!', 'chained name property is cast to an empty string'); diff --git a/test/built-ins/AggregateError/prototype/toString/get-name-toString-object.js b/test/built-ins/AggregateError/prototype/toString/get-name-toString-object.js deleted file mode 100644 index 39bf62d6746..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/get-name-toString-object.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - ToString on the name object value -info: | - AggregateError.prototype.toString ( ) - - 1. Let O be the this value. - 2. If Type(O) is not Object, throw a TypeError exception. - 3. Let name be ? Get(O, "name"). - 4. If name is undefined, set name to "AggregateError"; otherwise set name to ? ToString(name). - 5. Let msg be ? Get(O, "message"). - 6. If msg is undefined, set msg to the empty String; otherwise set msg to ? ToString(msg). - 7. If name is the empty String, return msg. - 8. If msg is the empty String, return name. - 9. Return the string-concatenation of name, the code unit 0x003A (COLON), the code unit 0x0020 (SPACE) and msg. -features: [AggregateError, Symbol.toPrimitive] ----*/ - -var method = AggregateError.prototype.toString; - -var called = 0; -var obj = { - name: { - [Symbol.toPrimitive]() { - called += 1; - return 'from @@toPrimitive'; - }, - toString() { - throw new Test262Error(); - }, - valueOf() { - throw new Test262Error(); - }, - }, - message: '', -}; - -var result = method.call(obj); - -assert.sameValue(called, 1); -assert.sameValue(result, 'from @@toPrimitive'); - -called = 0; -obj = { - name: { - [Symbol.toPrimitive]: undefined, - toString() { - called += 1; - return 'from the toString method'; - }, - valueOf() { - throw new Test262Error(); - }, - }, - message: '', -}; -result = false; - -result = method.call(obj); -assert.sameValue(called, 1); -assert.sameValue(result, 'from the toString method'); - -called = 0; -obj = { - name: { - [Symbol.toPrimitive]: undefined, - toString: undefined, - valueOf() { - called += 1; - return 'from the valueOf method'; - }, - }, - message: '', -}; -result = false; - -result = method.call(obj); -assert.sameValue(called, 1); -assert.sameValue(result, 'from the valueOf method'); diff --git a/test/built-ins/AggregateError/prototype/toString/get-name-toString-symbol.js b/test/built-ins/AggregateError/prototype/toString/get-name-toString-symbol.js deleted file mode 100644 index 6b17b58281b..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/get-name-toString-symbol.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - ToString(name) -info: | - AggregateError.prototype.toString ( ) - - 1. Let O be the this value. - 2. If Type(O) is not Object, throw a TypeError exception. - 3. Let name be ? Get(O, "name"). - 4. If name is undefined, set name to "AggregateError"; otherwise set name to ? ToString(name). - 5. Let msg be ? Get(O, "message"). - 6. If msg is undefined, set msg to the empty String; otherwise set msg to ? ToString(msg). - 7. If name is the empty String, return msg. - 8. If msg is the empty String, return name. - 9. Return the string-concatenation of name, the code unit 0x003A (COLON), the code unit 0x0020 (SPACE) and msg. -features: [AggregateError, Symbol] ----*/ - -var method = AggregateError.prototype.toString; - -var obj = { name: Symbol(), message: '' }; - -assert.throws(TypeError, function() { - method.call(obj); -}, 'own property'); - -obj = Object.create({ name: Symbol(), message: '' }); -assert.throws(TypeError, function() { - method.call(obj); -}, 'from prototype'); diff --git a/test/built-ins/AggregateError/prototype/toString/get-name-toString-undefined.js b/test/built-ins/AggregateError/prototype/toString/get-name-toString-undefined.js deleted file mode 100644 index 1ed8337b7b0..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/get-name-toString-undefined.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - ToString(name) where it can return "undefined" -info: | - AggregateError.prototype.toString ( ) - - 1. Let O be the this value. - 2. If Type(O) is not Object, throw a TypeError exception. - 3. Let name be ? Get(O, "name"). - 4. If name is undefined, set name to "AggregateError"; otherwise set name to ? ToString(name). - 5. Let msg be ? Get(O, "message"). - 6. If msg is undefined, set msg to the empty String; otherwise set msg to ? ToString(msg). - 7. If name is the empty String, return msg. - 8. If msg is the empty String, return name. - 9. Return the string-concatenation of name, the code unit 0x003A (COLON), the code unit 0x0020 (SPACE) and msg. -features: [AggregateError] ----*/ - -var method = AggregateError.prototype.toString; - -var obj = { - name: { - toString() { - return undefined; - } - }, - message: '', -}; - -assert.sameValue(method.call(obj), 'undefined', 'without message'); - -obj.message = 'lol'; - -assert.sameValue(method.call(obj), 'undefined\u003A\u0020lol', 'with message'); diff --git a/test/built-ins/AggregateError/prototype/toString/get-name-toString.js b/test/built-ins/AggregateError/prototype/toString/get-name-toString.js deleted file mode 100644 index 2aaf95d4758..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/get-name-toString.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - ToString(name) -info: | - AggregateError.prototype.toString ( ) - - 1. Let O be the this value. - 2. If Type(O) is not Object, throw a TypeError exception. - 3. Let name be ? Get(O, "name"). - 4. If name is undefined, set name to "AggregateError"; otherwise set name to ? ToString(name). - 5. Let msg be ? Get(O, "message"). - 6. If msg is undefined, set msg to the empty String; otherwise set msg to ? ToString(msg). - 7. If name is the empty String, return msg. - 8. If msg is the empty String, return name. - 9. Return the string-concatenation of name, the code unit 0x003A (COLON), the code unit 0x0020 (SPACE) and msg. -features: [AggregateError] ----*/ - -var method = AggregateError.prototype.toString; - -var obj = { message: '' }; - -obj.name = 0; -assert.sameValue(method.call(obj), '0', 'Number 0'); -obj.name = null; -assert.sameValue(method.call(obj), 'null', 'null'); -obj.name = false; -assert.sameValue(method.call(obj), 'false', 'false'); -obj.name = true; -assert.sameValue(method.call(obj), 'true', 'true'); -obj.name = 1; -assert.sameValue(method.call(obj), '1', 'Number 1'); diff --git a/test/built-ins/AggregateError/prototype/toString/get-name-undefined.js b/test/built-ins/AggregateError/prototype/toString/get-name-undefined.js deleted file mode 100644 index 01d5d2745b3..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/get-name-undefined.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - An undefined name property value is cast to 'AggregateError' -info: | - AggregateError.prototype.toString ( ) - - 1. Let O be the this value. - 2. If Type(O) is not Object, throw a TypeError exception. - 3. Let name be ? Get(O, "name"). - 4. If name is undefined, set name to "AggregateError"; otherwise set name to ? ToString(name). - 5. Let msg be ? Get(O, "message"). - 6. If msg is undefined, set msg to the empty String; otherwise set msg to ? ToString(msg). - 7. If name is the empty String, return msg. - 8. If msg is the empty String, return name. - 9. Return the string-concatenation of name, the code unit 0x003A (COLON), the code unit 0x0020 (SPACE) and msg. -features: [AggregateError] ----*/ - -var method = AggregateError.prototype.toString; - -var result = method.call({ - name: undefined, - message: '', -}); - -assert.sameValue(result, 'AggregateError', 'explicit from own property'); - -result = false; -result = method.call({ - message: '', -}); - -assert.sameValue(result, 'AggregateError', 'implicit'); - -result = false; -result = method.call(Object.create({ - name: undefined, - message: '', -})); - -assert.sameValue(result, 'AggregateError', 'explicit from prototype'); - -result = false; -result = method.call({ - name: undefined, - message: 'a message', -}); - -assert.sameValue(result, 'AggregateError\u003A\u0020a message', 'explicit from own property, message is set'); - -result = false; -result = method.call({ - message: 'a message', -}); - -assert.sameValue(result, 'AggregateError\u003A\u0020a message', 'implicit, message is set'); - -result = false; -result = method.call(Object.create({ - name: undefined, - message: 'a message', -})); - -assert.sameValue(result, 'AggregateError\u003A\u0020a message', 'explicit from prototype, message is set'); diff --git a/test/built-ins/AggregateError/prototype/toString/get-name.js b/test/built-ins/AggregateError/prototype/toString/get-name.js deleted file mode 100644 index 8926bc8c3d9..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/get-name.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - Gets the Object name -info: | - AggregateError.prototype.toString ( ) - - 1. Let O be the this value. - 2. If Type(O) is not Object, throw a TypeError exception. - 3. Let name be ? Get(O, "name"). - 4. If name is undefined, set name to "AggregateError"; otherwise set name to ? ToString(name). - ... -features: [AggregateError] ----*/ - -var method = AggregateError.prototype.toString; - -var called = 0; -var obj = { - get name() { - called += 1; - } -}; - -method.call(obj); - -assert.sameValue(called, 1); diff --git a/test/built-ins/AggregateError/prototype/toString/length.js b/test/built-ins/AggregateError/prototype/toString/length.js deleted file mode 100644 index 949e053a263..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/length.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - Property descriptor of AggregateError.prototype.toString.length -info: | - AggregateError.prototype.toString - - 17 ECMAScript Standard Built-in Objects: - Every built-in Function object, including constructors, has a length - property whose value is an integer. Unless otherwise specified, this - value is equal to the largest number of named arguments shown in the - subclause headings for the function description, including optional - parameters. However, rest parameters shown using the form “...name” - are not included in the default argument count. - - Unless otherwise specified, the length property of a built-in Function - object has the attributes { [[Writable]]: false, [[Enumerable]]: false, - [[Configurable]]: true }. -includes: [propertyHelper.js] -features: [AggregateError] ----*/ - -verifyProperty(AggregateError.prototype.toString, 'length', { - value: 0, - enumerable: false, - writable: false, - configurable: true -}); diff --git a/test/built-ins/AggregateError/prototype/toString/name.js b/test/built-ins/AggregateError/prototype/toString/name.js deleted file mode 100644 index f44abe5e3de..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/name.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - Property descriptor of AggregateError.prototype.toString.name -info: | - AggregateError.prototype.toString - - 17 ECMAScript Standard Built-in Objects - - Functions that are specified as get or set accessor functions of built-in - properties have "get " or "set " prepended to the property name string. -includes: [propertyHelper.js] -features: [AggregateError] ----*/ - -verifyProperty(AggregateError.prototype.toString, 'name', { - value: 'toString', - enumerable: false, - writable: false, - configurable: true -}); diff --git a/test/built-ins/AggregateError/prototype/toString/prop-desc.js b/test/built-ins/AggregateError/prototype/toString/prop-desc.js deleted file mode 100644 index a5cc8c6a4a7..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/prop-desc.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - Property descriptor of AggregateError.prototype.toString -info: | - ES Section 17 - - Every other data property (...) has the attributes { [[Writable]]: true, [[Enumerable]]: false, - [[Configurable]]: true } unless otherwise specified. -includes: [propertyHelper.js] -features: [AggregateError] ----*/ - -assert.sameValue(typeof AggregateError.prototype.toString, 'function'); - -verifyProperty(AggregateError.prototype, 'toString', { - configurable: true, - writable: true, - enumerable: false, -}); diff --git a/test/built-ins/AggregateError/prototype/toString/returns-string.js b/test/built-ins/AggregateError/prototype/toString/returns-string.js deleted file mode 100644 index b528719974d..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/returns-string.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - Returns a string concatenating name and msg when both are defined -info: | - AggregateError.prototype.toString ( ) - - 1. Let O be the this value. - 2. If Type(O) is not Object, throw a TypeError exception. - 3. Let name be ? Get(O, "name"). - 4. If name is undefined, set name to "AggregateError"; otherwise set name to ? ToString(name). - 5. Let msg be ? Get(O, "message"). - 6. If msg is undefined, set msg to the empty String; otherwise set msg to ? ToString(msg). - 7. If name is the empty String, return msg. - 8. If msg is the empty String, return name. - 9. Return the string-concatenation of name, the code unit 0x003A (COLON), the code unit 0x0020 (SPACE) and msg. -features: [AggregateError] ----*/ - -var method = AggregateError.prototype.toString; - -var obj = { - name: 'foo', - message: 'bar', -}; - -assert.sameValue(method.call(obj), 'foo\u003A\u0020bar'); - -obj = new AggregateError(['a', 'b', 'c'], 'Hello World!'); - -assert.sameValue(method.call(obj), 'AggregateError\u003A\u0020Hello World!'); - -obj = new AggregateError(['a', 'b', 'c']); - -assert.sameValue(method.call(obj), 'AggregateError'); diff --git a/test/built-ins/AggregateError/prototype/toString/this-not-object-throws.js b/test/built-ins/AggregateError/prototype/toString/this-not-object-throws.js deleted file mode 100644 index 22b958f5816..00000000000 --- a/test/built-ins/AggregateError/prototype/toString/this-not-object-throws.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (C) 2019 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-aggregate-error.prototype.toString -description: > - Property descriptor of AggregateError.prototype.toString -info: | - AggregateError.prototype.toString ( ) - - 1. Let O be the this value. - 2. If Type(O) is not Object, throw a TypeError exception. -features: [AggregateError, Symbol] ----*/ - -var method = AggregateError.prototype.toString; - -assert.throws(TypeError, () => { - method.call(undefined); -}, 'undefined'); - -assert.throws(TypeError, () => { - method.call(null); -}, 'null'); - -assert.throws(TypeError, () => { - method.call(false); -}, 'false'); - -assert.throws(TypeError, () => { - method.call(true); -}, 'true'); - -assert.throws(TypeError, () => { - method.call(42); -}, 'number'); - -assert.throws(TypeError, () => { - method.call('string'); -}, 'string'); - -var s = Symbol(); -assert.throws(TypeError, () => { - method.call(s); -}, 'symbol');