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

Unified Diff: runtime/vm/ast.cc

Issue 1259813003: Fix #23871: identical on consts should be always const (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: fix Created 5 years, 5 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 | « no previous file | tests/language/const_syntax_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.cc
diff --git a/runtime/vm/ast.cc b/runtime/vm/ast.cc
index ef224e29aa84a4f1802839e064628e8d73ca5c9a..0daa093eba12cfc7b5da2f9c5a77b926449421eb 100644
--- a/runtime/vm/ast.cc
+++ b/runtime/vm/ast.cc
@@ -229,8 +229,6 @@ const Instance* ComparisonNode::EvalConstExpr() const {
return NULL;
case Token::kEQ:
case Token::kNE:
- case Token::kEQ_STRICT:
- case Token::kNE_STRICT:
// The comparison is a compile time const if both operands are either a
// number, string, or boolean value (but not necessarily the same type).
if ((left_val->IsNumber() ||
@@ -244,6 +242,9 @@ const Instance* ComparisonNode::EvalConstExpr() const {
return &Bool::False();
}
return NULL;
+ case Token::kEQ_STRICT:
+ case Token::kNE_STRICT:
hausner 2015/07/28 18:01:58 // identical(a, b) is a compile time const if both
srdjan 2015/07/28 18:36:08 Done.
+ return &Bool::True();
default:
return NULL;
}
« no previous file with comments | « no previous file | tests/language/const_syntax_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698