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

Side by Side Diff: src/regexp.js

Issue 1140053002: Migrate error messages, part 11. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « src/pending-compilation-error-handler.cc ('k') | src/runtime.js » ('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 var $regexpExec; 5 var $regexpExec;
6 var $regexpExecNoTests; 6 var $regexpExecNoTests;
7 var $regexpLastMatchInfo; 7 var $regexpLastMatchInfo;
8 var $regexpLastMatchInfoOverride; 8 var $regexpLastMatchInfoOverride;
9 var harmony_regexps = false; 9 var harmony_regexps = false;
10 var harmony_unicode_regexps = false; 10 var harmony_unicode_regexps = false;
(...skipping 30 matching lines...) Expand all
41 // function. 41 // function.
42 $regexpLastMatchInfoOverride = null; 42 $regexpLastMatchInfoOverride = null;
43 43
44 // ------------------------------------------------------------------- 44 // -------------------------------------------------------------------
45 45
46 // A recursive descent parser for Patterns according to the grammar of 46 // A recursive descent parser for Patterns according to the grammar of
47 // ECMA-262 15.10.1, with deviations noted below. 47 // ECMA-262 15.10.1, with deviations noted below.
48 function DoConstructRegExp(object, pattern, flags) { 48 function DoConstructRegExp(object, pattern, flags) {
49 // RegExp : Called as constructor; see ECMA-262, section 15.10.4. 49 // RegExp : Called as constructor; see ECMA-262, section 15.10.4.
50 if (IS_REGEXP(pattern)) { 50 if (IS_REGEXP(pattern)) {
51 if (!IS_UNDEFINED(flags)) { 51 if (!IS_UNDEFINED(flags)) throw MakeTypeError(kRegExpFlags);
52 throw MakeTypeError('regexp_flags', []);
53 }
54 flags = (pattern.global ? 'g' : '') 52 flags = (pattern.global ? 'g' : '')
55 + (pattern.ignoreCase ? 'i' : '') 53 + (pattern.ignoreCase ? 'i' : '')
56 + (pattern.multiline ? 'm' : ''); 54 + (pattern.multiline ? 'm' : '');
57 if (harmony_unicode_regexps) 55 if (harmony_unicode_regexps)
58 flags += (pattern.unicode ? 'u' : ''); 56 flags += (pattern.unicode ? 'u' : '');
59 if (harmony_regexps) 57 if (harmony_regexps)
60 flags += (pattern.sticky ? 'y' : ''); 58 flags += (pattern.sticky ? 'y' : '');
61 pattern = pattern.source; 59 pattern = pattern.source;
62 } 60 }
63 61
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 %DefineAccessorPropertyUnchecked(GlobalRegExp, '$' + i, 440 %DefineAccessorPropertyUnchecked(GlobalRegExp, '$' + i,
443 RegExpMakeCaptureGetter(i), NoOpSetter, 441 RegExpMakeCaptureGetter(i), NoOpSetter,
444 DONT_DELETE); 442 DONT_DELETE);
445 } 443 }
446 %ToFastProperties(GlobalRegExp); 444 %ToFastProperties(GlobalRegExp);
447 445
448 $regexpExecNoTests = RegExpExecNoTests; 446 $regexpExecNoTests = RegExpExecNoTests;
449 $regexpExec = DoRegExpExec; 447 $regexpExec = DoRegExpExec;
450 448
451 }) 449 })
OLDNEW
« no previous file with comments | « src/pending-compilation-error-handler.cc ('k') | src/runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698