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

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

Issue 2032713003: [regexp] fix subtle bug in RegExpTest. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 | no next file » | 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 } 318 }
319 this.lastIndex = RegExpLastMatchInfo[CAPTURE1]; 319 this.lastIndex = RegExpLastMatchInfo[CAPTURE1];
320 return true; 320 return true;
321 } else { 321 } else {
322 // Non-global, non-sticky regexp. 322 // Non-global, non-sticky regexp.
323 // Remove irrelevant preceeding '.*' in a test regexp. The expression 323 // Remove irrelevant preceeding '.*' in a test regexp. The expression
324 // checks whether this.source starts with '.*' and that the third char is 324 // checks whether this.source starts with '.*' and that the third char is
325 // not a '?'. But see https://code.google.com/p/v8/issues/detail?id=3560 325 // not a '?'. But see https://code.google.com/p/v8/issues/detail?id=3560
326 var regexp = this; 326 var regexp = this;
327 var source = REGEXP_SOURCE(regexp); 327 var source = REGEXP_SOURCE(regexp);
328 if (regexp.length >= 3 && 328 if (source.length >= 3 &&
329 %_StringCharCodeAt(regexp, 0) == 46 && // '.' 329 %_StringCharCodeAt(source, 0) == 46 && // '.'
330 %_StringCharCodeAt(regexp, 1) == 42 && // '*' 330 %_StringCharCodeAt(source, 1) == 42 && // '*'
331 %_StringCharCodeAt(regexp, 2) != 63) { // '?' 331 %_StringCharCodeAt(source, 2) != 63) { // '?'
332 regexp = TrimRegExp(regexp); 332 regexp = TrimRegExp(regexp);
333 } 333 }
334 // matchIndices is either null or the RegExpLastMatchInfo array. 334 // matchIndices is either null or the RegExpLastMatchInfo array.
335 var matchIndices = %_RegExpExec(regexp, string, 0, RegExpLastMatchInfo); 335 var matchIndices = %_RegExpExec(regexp, string, 0, RegExpLastMatchInfo);
336 if (IS_NULL(matchIndices)) { 336 if (IS_NULL(matchIndices)) {
337 this.lastIndex = 0; 337 this.lastIndex = 0;
338 return false; 338 return false;
339 } 339 }
340 return true; 340 return true;
341 } 341 }
(...skipping 895 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 | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698