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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 assertEquals("klp", ascii.substring(10,12) + ascii.substring(15,16)); | 182 assertEquals("klp", ascii.substring(10,12) + ascii.substring(15,16)); |
183 assertEquals("\u03B1\u03B4\u03B5", utf.substring(0,1) + utf.substring(5,3)); | 183 assertEquals("\u03B1\u03B4\u03B5", utf.substring(0,1) + utf.substring(5,3)); |
184 assertEquals("", ascii.substring(16) + utf.substring(16)); | 184 assertEquals("", ascii.substring(16) + utf.substring(16)); |
185 assertEquals("bcdef\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9", | 185 assertEquals("bcdef\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9", |
186 ascii.substring(1,6) + utf.substring(3,9)); | 186 ascii.substring(1,6) + utf.substring(3,9)); |
187 assertEquals("\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9abcdefghijklmnop", | 187 assertEquals("\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9abcdefghijklmnop", |
188 utf.substring(3,9) + ascii); | 188 utf.substring(3,9) + ascii); |
189 assertEquals("\u03B2\u03B3\u03B4\u03B5\u03B4\u03B5\u03B6\u03B7", | 189 assertEquals("\u03B2\u03B3\u03B4\u03B5\u03B4\u03B5\u03B6\u03B7", |
190 utf.substring(5,1) + utf.substring(3,7)); | 190 utf.substring(5,1) + utf.substring(3,7)); |
191 | 191 |
192 /* | |
193 // Externalizing strings. | 192 // Externalizing strings. |
194 var a = "123456789qwertyuiopasdfghjklzxcvbnm"; | 193 var a = "123456789" + "qwertyuiopasdfghjklzxcvbnm"; |
195 var b = a.slice(1,-1); | 194 var b = "23456789qwertyuiopasdfghjklzxcvbn" |
196 assertEquals(a.slice(1,-1), b); | 195 assertEquals(a.slice(1,-1), b); |
197 externalizeString(a); | 196 |
| 197 assertTrue(isAsciiString(a)); |
| 198 externalizeString(a, true); |
| 199 assertFalse(isAsciiString(a)); |
| 200 |
198 assertEquals(a.slice(1,-1), b); | 201 assertEquals(a.slice(1,-1), b); |
199 */ | 202 assertTrue(/3456789qwe/.test(a)); |
| 203 assertEquals(5, a.indexOf("678")); |
| 204 assertEquals("12345", a.split("6")[0]); |
OLD | NEW |