Always parse octal literals correctly even if we're in strict mode and therefore shouldn't be allowing them.
@@ -3045,7 +3045,6 @@ class IRFactory {
}
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
- if (!inStrictContext()) {
double v = 0;
int c = 0;
while (++c < length) {
@@ -3058,15 +3057,15 @@ class IRFactory {
return 0;
}
}
+ if (inStrictContext()) {
+ // TODO(tbreisacher): Make this an error instead of a warning.
errorReporter.warning(INVALID_ES5_STRICT_OCTAL, sourceName,
lineno(location.start), charno(location.start));
- return v;
} else {
- // TODO(tbreisacher): Make this an error instead of a warning.
errorReporter.warning(INVALID_ES5_STRICT_OCTAL, sourceName,
lineno(location.start), charno(location.start));
- return Double.valueOf(value);
}
+ return v;
case '8': case '9':
errorReporter.error(INVALID_OCTAL_DIGIT, sourceName,
lineno(location.start), charno(location.start));
