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

Unified Diff: src/preparser.h

Issue 917703003: [strong] no sloppy equality (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index 4b526f5f1f3c6f039ae730c70b07eccfa8a20444..33d87da6fb2128b4ad56e2bad445cd875d8d4df5 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -2445,6 +2445,7 @@ ParserBase<Traits>::ParseBinaryExpression(int prec, bool accept_IN, bool* ok) {
// prec1 >= 4
while (Precedence(peek(), accept_IN) == prec1) {
Token::Value op = Next();
+ Scanner::Location op_location = scanner()->location();
int pos = position();
ExpressionT y = ParseBinaryExpression(prec1 + 1, accept_IN, CHECK_OK);
@@ -2464,6 +2465,11 @@ ParserBase<Traits>::ParseBinaryExpression(int prec, bool accept_IN, bool* ok) {
case Token::NE_STRICT: cmp = Token::EQ_STRICT; break;
default: break;
}
+ if (cmp == Token::EQ && is_strong(language_mode())) {
+ ReportMessageAt(op_location, "strong_equal");
+ *ok = false;
+ return this->EmptyExpression();
+ }
x = factory()->NewCompareOperation(cmp, x, y, pos);
if (cmp != op) {
// The comparison was negated - add a NOT.

Powered by Google App Engine
This is Rietveld 408576698