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

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: comment 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..26618b51f23308e76dfb7051f3f86006c1836b62 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,11 @@ const Instance* ComparisonNode::EvalConstExpr() const {
return &Bool::False();
}
return NULL;
+ case Token::kEQ_STRICT:
+ case Token::kNE_STRICT:
+ // identical(a, b) is a compile time const if both operands are
+ // compile time constants, regardless of their type.
+ 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