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

Unified Diff: src/scanner.cc

Issue 700373003: Scanner: disallow unicode escapes in regexp flags. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: test update Created 6 years, 1 month 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/scanner.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scanner.cc
diff --git a/src/scanner.cc b/src/scanner.cc
index e63239d6eb0d3afed82d7af59498cc6c9a1cbfe4..ddcd937584d50fc45fa921a25e2a5d21fcf5697e 100644
--- a/src/scanner.cc
+++ b/src/scanner.cc
@@ -1138,24 +1138,6 @@ bool Scanner::ScanRegExpPattern(bool seen_equal) {
}
-bool Scanner::ScanLiteralUnicodeEscape() {
- DCHECK(c0_ == '\\');
- AddLiteralChar(c0_);
- Advance();
- int hex_digits_read = 0;
- if (c0_ == 'u') {
- AddLiteralChar(c0_);
- while (hex_digits_read < 4) {
- Advance();
- if (!IsHexDigit(c0_)) break;
- AddLiteralChar(c0_);
- ++hex_digits_read;
- }
- }
- return hex_digits_read == 4;
-}
-
-
bool Scanner::ScanRegExpFlags() {
// Scan regular expression flags.
LiteralScope literal(this);
@@ -1163,10 +1145,7 @@ bool Scanner::ScanRegExpFlags() {
if (c0_ != '\\') {
AddLiteralCharAdvance();
} else {
- if (!ScanLiteralUnicodeEscape()) {
- return false;
- }
- Advance();
+ return false;
}
}
literal.Complete();
« no previous file with comments | « src/scanner.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698