Add a test for String.prototype.concat() with single Object argument

v8 would fail this test, so it would be nice to have it
This commit is contained in:
⭐caitp⭐ 2015-03-23 10:15:09 -04:00
parent ceeefa3196
commit 9a37120014
1 changed files with 5 additions and 2 deletions

View File

@ -7,7 +7,7 @@ es5id: 15.5.4.6_A1_T10
description: Call concat([,[...]]) function with object arguments
---*/
var __obj = {toString:function(){return "\u0041";}}
var __obj = {toString:function(){return "\u0041";}, valueOf:function(){return "_\u0041_";}}
var __obj2 = {toString:function(){return true;}}
var __obj3 = {toString:function(){return 42;}}
var __str = "lego";
@ -15,8 +15,11 @@ var __str = "lego";
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
with(__str){
if (concat(__obj) !== "legoA") {
$ERROR('#1: var x; var __obj = {toString:function(){return "\u0041";}, valueOf:function(){return "_\u0041_";}}; var __str = "lego"; concat(__obj) === "legoA". Actual: '+concat(__obj) );
}
if (concat(__obj, __obj2, __obj3, x) !== "legoAtrue42undefined") {
$ERROR('#1: var x; var __obj = {toString:function(){return "\u0041";}}; var __obj2 = {toString:function(){return true;}}; var __obj3 = {toString:function(){return 42;}}; var __str = "lego"; concat(__obj, __obj2, __obj3, x) === "legoAtrue42undefined". Actual: '+concat(__obj, __obj2, __obj3, x) );
$ERROR('#2: var x; var __obj = {toString:function(){return "\u0041";}, valueOf:function(){return "_\u0041_";}}; var __obj2 = {toString:function(){return true;}}; var __obj3 = {toString:function(){return 42;}}; var __str = "lego"; concat(__obj, __obj2, __obj3, x) === "legoAtrue42undefined". Actual: '+concat(__obj, __obj2, __obj3, x) );
}
}
//