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

Unified Diff: src/regexp.js

Issue 7778013: NewGC: Merge bleeding edge up to 9009. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/profile-generator.cc ('k') | src/rewriter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp.js
===================================================================
--- src/regexp.js (revision 9006)
+++ src/regexp.js (working copy)
@@ -50,24 +50,29 @@
var global = false;
var ignoreCase = false;
var multiline = false;
-
for (var i = 0; i < flags.length; i++) {
var c = %_CallFunction(flags, i, StringCharAt);
switch (c) {
case 'g':
- // Allow duplicate flags to be consistent with JSC and others.
+ if (global) {
+ throw MakeSyntaxError("invalid_regexp_flags", [flags]);
+ }
global = true;
break;
case 'i':
+ if (ignoreCase) {
+ throw MakeSyntaxError("invalid_regexp_flags", [flags]);
+ }
ignoreCase = true;
break;
case 'm':
+ if (multiline) {
+ throw MakeSyntaxError("invalid_regexp_flags", [flags]);
+ }
multiline = true;
break;
default:
- // Ignore flags that have no meaning to be consistent with
- // JSC.
- break;
+ throw MakeSyntaxError("invalid_regexp_flags", [flags]);
}
}
Property changes on: src/regexp.js
___________________________________________________________________
Modified: svn:mergeinfo
Merged /branches/bleeding_edge/src/regexp.js:r8863-9019
« no previous file with comments | « src/profile-generator.cc ('k') | src/rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698