| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 19 matching lines...) Expand all Loading... |
| 30 // Sparse arrays with length 42000. | 30 // Sparse arrays with length 42000. |
| 31 var sparse_array = []; | 31 var sparse_array = []; |
| 32 sparse_array[100] = 3; | 32 sparse_array[100] = 3; |
| 33 sparse_array[200] = undefined; | 33 sparse_array[200] = undefined; |
| 34 sparse_array[300] = 4; | 34 sparse_array[300] = 4; |
| 35 sparse_array[400] = 5; | 35 sparse_array[400] = 5; |
| 36 sparse_array[500] = 6; | 36 sparse_array[500] = 6; |
| 37 sparse_array[600] = 5; | 37 sparse_array[600] = 5; |
| 38 sparse_array[700] = 4; | 38 sparse_array[700] = 4; |
| 39 sparse_array[800] = undefined; | 39 sparse_array[800] = undefined; |
| 40 sparse_array[900] = 3 | 40 sparse_array[900] = 3; |
| 41 sparse_array[41999] = "filler"; | 41 sparse_array[41999] = "filler"; |
| 42 | 42 |
| 43 var dense_object = { 0: 42, 1: 37, length: 2 }; | 43 var dense_object = { 0: 42, 1: 37, length: 2 }; |
| 44 var sparse_object = { 0: 42, 100000: 37, length: 200000 }; | 44 var sparse_object = { 0: 42, 100000: 37, length: 200000 }; |
| 45 var funky_object = { 10:42, 100000: 42, 100001: 37, length: 50000 }; | 45 var funky_object = { 10:42, 100000: 42, 100001: 37, length: 50000 }; |
| 46 var infinite_object = { 10: 42, 100000: 37, length: Infinity }; | 46 var infinite_object = { 10: 42, 100000: 37, length: Infinity }; |
| 47 | 47 |
| 48 // ---------------------------------------------------------------------- | 48 // ---------------------------------------------------------------------- |
| 49 // Array.prototype.indexOf. | 49 // Array.prototype.indexOf. |
| 50 // ---------------------------------------------------------------------- | 50 // ---------------------------------------------------------------------- |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 177 |
| 178 assertEquals(0, Array.prototype.lastIndexOf.call(sparse_object, 42)); | 178 assertEquals(0, Array.prototype.lastIndexOf.call(sparse_object, 42)); |
| 179 assertEquals(100000, Array.prototype.lastIndexOf.call(sparse_object, 37)); | 179 assertEquals(100000, Array.prototype.lastIndexOf.call(sparse_object, 37)); |
| 180 assertEquals(-1, Array.prototype.lastIndexOf.call(sparse_object, 87)); | 180 assertEquals(-1, Array.prototype.lastIndexOf.call(sparse_object, 87)); |
| 181 | 181 |
| 182 assertEquals(10, Array.prototype.lastIndexOf.call(funky_object, 42, 15)); | 182 assertEquals(10, Array.prototype.lastIndexOf.call(funky_object, 42, 15)); |
| 183 assertEquals(10, Array.prototype.lastIndexOf.call(funky_object, 42)); | 183 assertEquals(10, Array.prototype.lastIndexOf.call(funky_object, 42)); |
| 184 assertEquals(-1, Array.prototype.lastIndexOf.call(funky_object, 37)); | 184 assertEquals(-1, Array.prototype.lastIndexOf.call(funky_object, 37)); |
| 185 | 185 |
| 186 assertEquals(-1, Array.prototype.lastIndexOf.call(infinite_object, 42)); | 186 assertEquals(-1, Array.prototype.lastIndexOf.call(infinite_object, 42)); |
| OLD | NEW |