| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 | 28 |
| 29 var should_throw_on_null_and_undefined = | 29 var should_throw_on_null_and_undefined = |
| 30 [Object.prototype.toLocaleString, | 30 [Object.prototype.toLocaleString, |
| 31 Object.prototype.valueOf, | 31 Object.prototype.valueOf, |
| 32 Object.prototype.hasOwnProperty, | 32 Object.prototype.hasOwnProperty, |
| 33 Object.prototype.isPrototypeOf, | 33 Object.prototype.isPrototypeOf, |
| 34 Object.prototype.propertyIsEnumerable, | 34 Object.prototype.propertyIsEnumerable, |
| 35 Array.prototype.toString, | |
| 36 Array.prototype.toLocaleString, | |
| 37 Array.prototype.concat, | 35 Array.prototype.concat, |
| 38 Array.prototype.join, | 36 Array.prototype.join, |
| 39 Array.prototype.pop, | 37 Array.prototype.pop, |
| 40 Array.prototype.push, | 38 Array.prototype.push, |
| 41 Array.prototype.reverse, | 39 Array.prototype.reverse, |
| 42 Array.prototype.shift, | 40 Array.prototype.shift, |
| 43 Array.prototype.slice, | 41 Array.prototype.slice, |
| 44 Array.prototype.sort, | 42 Array.prototype.sort, |
| 45 Array.prototype.splice, | 43 Array.prototype.splice, |
| 46 Array.prototype.unshift, | 44 Array.prototype.unshift, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 70 String.prototype.toUpperCase, | 68 String.prototype.toUpperCase, |
| 71 String.prototype.toLocaleUpperCase, | 69 String.prototype.toLocaleUpperCase, |
| 72 String.prototype.trim, | 70 String.prototype.trim, |
| 73 Number.prototype.toLocaleString, | 71 Number.prototype.toLocaleString, |
| 74 Error.prototype.toString]; | 72 Error.prototype.toString]; |
| 75 | 73 |
| 76 // Non generic natives does not work on any input other than the specific | 74 // Non generic natives does not work on any input other than the specific |
| 77 // type, but since this change will allow call to be invoked with undefined | 75 // type, but since this change will allow call to be invoked with undefined |
| 78 // or null as this we still explicitly test that we throw on these here. | 76 // or null as this we still explicitly test that we throw on these here. |
| 79 var non_generic = | 77 var non_generic = |
| 80 [Function.prototype.toString, | 78 [Array.prototype.toString, |
| 79 Array.prototype.toLocaleString, |
| 80 Function.prototype.toString, |
| 81 Function.prototype.call, | 81 Function.prototype.call, |
| 82 Function.prototype.apply, | 82 Function.prototype.apply, |
| 83 String.prototype.toString, | 83 String.prototype.toString, |
| 84 String.prototype.valueOf, | 84 String.prototype.valueOf, |
| 85 Boolean.prototype.toString, | 85 Boolean.prototype.toString, |
| 86 Boolean.prototype.valueOf, | 86 Boolean.prototype.valueOf, |
| 87 Number.prototype.toString, | 87 Number.prototype.toString, |
| 88 Number.prototype.valueOf, | 88 Number.prototype.valueOf, |
| 89 Number.prototype.toFixed, | 89 Number.prototype.toFixed, |
| 90 Number.prototype.toExponential, | 90 Number.prototype.toExponential, |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 } | 317 } |
| 318 } | 318 } |
| 319 | 319 |
| 320 | 320 |
| 321 // Object.prototype.toString() | 321 // Object.prototype.toString() |
| 322 assertEquals(Object.prototype.toString.call(null), | 322 assertEquals(Object.prototype.toString.call(null), |
| 323 '[object Null]') | 323 '[object Null]') |
| 324 | 324 |
| 325 assertEquals(Object.prototype.toString.call(undefined), | 325 assertEquals(Object.prototype.toString.call(undefined), |
| 326 '[object Undefined]') | 326 '[object Undefined]') |
| OLD | NEW |