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

Unified Diff: src/scanner-base.cc

Issue 6606002: Merge revision 6500-6600 from bleeding_edge to the isolates branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 years, 10 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
« src/ast.cc ('K') | « src/scanner-base.h ('k') | src/top.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scanner-base.cc
===================================================================
--- src/scanner-base.cc (revision 7030)
+++ src/scanner-base.cc (working copy)
@@ -97,9 +97,9 @@
// Octal escapes of the forms '\0xx' and '\xxx' are not a part of
// ECMA-262. Other JS VMs support them.
uc32 Scanner::ScanOctalEscape(uc32 c, int length) {
- octal_pos_ = source_pos() - 1; // Already advanced
uc32 x = c - '0';
- for (int i = 0; i < length; i++) {
+ int i = 0;
+ for (; i < length; i++) {
int d = c0_ - '0';
if (d < 0 || d > 7) break;
int nx = x * 8 + d;
@@ -107,6 +107,12 @@
x = nx;
Advance();
}
+ // Anything excelt '\0' is an octal escape sequence, illegal in strict mode.
+ // Remember the position of octal escape sequences so that better error
+ // can be reported later (in strict mode).
+ if (c != '0' || i > 0) {
+ octal_pos_ = source_pos() - i - 1; // Already advanced
+ }
return x;
}
« src/ast.cc ('K') | « src/scanner-base.h ('k') | src/top.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698