Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/js/regexp.js

Issue 1940643002: Avoid infinite loop in RegExp.prototype[Symbol.split] (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove another fail expectation Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/test262/test262.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, utils) { 5 (function(global, utils) {
6 6
7 'use strict'; 7 'use strict';
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 var stringIndex = prevStringIndex; 506 var stringIndex = prevStringIndex;
507 while (stringIndex < size) { 507 while (stringIndex < size) {
508 splitter.lastIndex = stringIndex; 508 splitter.lastIndex = stringIndex;
509 result = RegExpSubclassExec(splitter, string, exec); 509 result = RegExpSubclassExec(splitter, string, exec);
510 // Ensure exec will be read again on the next loop through. 510 // Ensure exec will be read again on the next loop through.
511 exec = UNDEFINED; 511 exec = UNDEFINED;
512 if (IS_NULL(result)) { 512 if (IS_NULL(result)) {
513 stringIndex += AdvanceStringIndex(string, stringIndex, unicode); 513 stringIndex += AdvanceStringIndex(string, stringIndex, unicode);
514 } else { 514 } else {
515 var end = MinSimple(TO_LENGTH(splitter.lastIndex), size); 515 var end = MinSimple(TO_LENGTH(splitter.lastIndex), size);
516 if (end === stringIndex) { 516 if (end === prevStringIndex) {
517 stringIndex += AdvanceStringIndex(string, stringIndex, unicode); 517 stringIndex += AdvanceStringIndex(string, stringIndex, unicode);
518 } else { 518 } else {
519 %AddElement( 519 %AddElement(
520 array, arrayIndex, 520 array, arrayIndex,
521 %_SubString(string, prevStringIndex, stringIndex)); 521 %_SubString(string, prevStringIndex, stringIndex));
522 arrayIndex++; 522 arrayIndex++;
523 if (arrayIndex === lim) return array; 523 if (arrayIndex === lim) return array;
524 prevStringIndex = end; 524 prevStringIndex = end;
525 var numberOfCaptures = MaxSimple(TO_LENGTH(result.length), 0); 525 var numberOfCaptures = MaxSimple(TO_LENGTH(result.length), 0);
526 for (var i = 1; i < numberOfCaptures; i++) { 526 for (var i = 1; i < numberOfCaptures; i++) {
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 to.RegExpSubclassExecJS = RegExpSubclassExecJS; 1237 to.RegExpSubclassExecJS = RegExpSubclassExecJS;
1238 to.RegExpSubclassMatch = RegExpSubclassMatch; 1238 to.RegExpSubclassMatch = RegExpSubclassMatch;
1239 to.RegExpSubclassReplace = RegExpSubclassReplace; 1239 to.RegExpSubclassReplace = RegExpSubclassReplace;
1240 to.RegExpSubclassSearch = RegExpSubclassSearch; 1240 to.RegExpSubclassSearch = RegExpSubclassSearch;
1241 to.RegExpSubclassSplit = RegExpSubclassSplit; 1241 to.RegExpSubclassSplit = RegExpSubclassSplit;
1242 to.RegExpSubclassTest = RegExpSubclassTest; 1242 to.RegExpSubclassTest = RegExpSubclassTest;
1243 to.RegExpTest = RegExpTest; 1243 to.RegExpTest = RegExpTest;
1244 }); 1244 });
1245 1245
1246 }) 1246 })
OLDNEW
« no previous file with comments | « no previous file | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698