Backed out 9 changesets (bug 1901851, bug 1728331) for causing remote worker crashes...
[gecko.git] / js / src / tests / test262 / built-ins / String / prototype / concat / S15.5.4.6_A4_T1.js
blob1cbb6fbcb28ddef327271701a3de302f33a09f44
1 // Copyright 2009 the Sputnik authors.  All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 info: |
6     when String.prototype.concat([,[...]]) is called first Call ToString,
7     giving it the this value as its argument
8 es5id: 15.5.4.6_A4_T1
9 description: Override toString function
10 ---*/
12 var __instance = {
13   toString: function() {
14     return "one"
15   }
18 __instance.concat = String.prototype.concat;
20 //////////////////////////////////////////////////////////////////////////////
21 //CHECK#1
22 if (__instance.concat("two", x) !== "onetwoundefined") {
23   throw new Test262Error('#1: var x; __instance = {toString:function(){return "one"}}; __instance.concat = String.prototype.concat;  __instance.concat("two",x) === "onetwoundefined". Actual: ' + __instance.concat("two", x));
26 //////////////////////////////////////////////////////////////////////////////
28 var x;
30 reportCompare(0, 0);