OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 var result = %StringSplit(subject, separator, limit); | 560 var result = %StringSplit(subject, separator, limit); |
561 | 561 |
562 return result; | 562 return result; |
563 } | 563 } |
564 | 564 |
565 var saveAnswer = false; | 565 var saveAnswer = false; |
566 | 566 |
567 %_Log('regexp', 'regexp-split,%0S,%1r', [subject, separator]); | 567 %_Log('regexp', 'regexp-split,%0S,%1r', [subject, separator]); |
568 | 568 |
569 if (length === 0) { | 569 if (length === 0) { |
570 if (splitMatch(separator, subject, 0, 0) != null) { | 570 if (DoRegExpExec(separator, subject, 0, 0) != null) { |
571 return []; | 571 return []; |
572 } | 572 } |
573 return [subject]; | 573 return [subject]; |
574 } | 574 } |
575 | 575 |
576 var currentIndex = 0; | 576 var currentIndex = 0; |
577 var startIndex = 0; | 577 var startIndex = 0; |
578 var result = []; | 578 var result = []; |
579 | 579 |
580 outer_loop: | 580 outer_loop: |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 "small", StringSmall, | 934 "small", StringSmall, |
935 "strike", StringStrike, | 935 "strike", StringStrike, |
936 "sub", StringSub, | 936 "sub", StringSub, |
937 "sup", StringSup, | 937 "sup", StringSup, |
938 "toJSON", StringToJSON | 938 "toJSON", StringToJSON |
939 )); | 939 )); |
940 } | 940 } |
941 | 941 |
942 | 942 |
943 SetupString(); | 943 SetupString(); |
OLD | NEW |