keith_miller@apple.com | bcc77f2 | 2016-07-15 06:03:25 +0000 | [diff] [blame] | 1 | // Copyright 2009 the Sputnik authors. All rights reserved. |
| 2 | // This code is governed by the BSD license found in the LICENSE file. |
| 3 | |
| 4 | /*--- |
| 5 | info: > |
| 6 | The [[Prototype]] property of the newly constructed object |
| 7 | is set to the original Array prototype object, the one that |
| 8 | is the initial value of Array.prototype |
| 9 | es5id: 15.4.1_A1.1_T2 |
| 10 | description: Array.prototype.toString = Object.prototype.toString |
| 11 | ---*/ |
| 12 | |
| 13 | //CHECK#1 |
| 14 | Array.prototype.toString = Object.prototype.toString; |
| 15 | var x = Array(); |
| 16 | if (x.toString() !== "[object " + "Array" + "]") { |
| 17 | $ERROR('#1: Array.prototype.toString = Object.prototype.toString; var x = Array(); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString())); |
| 18 | } |
| 19 | |
| 20 | //CHECK#2 |
| 21 | Array.prototype.toString = Object.prototype.toString; |
| 22 | var x = Array(0,1,2); |
| 23 | if (x.toString() !== "[object " + "Array" + "]") { |
| 24 | $ERROR('#2: Array.prototype.toString = Object.prototype.toString; var x = Array(0,1,2); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString())); |
| 25 | } |