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

Unified Diff: runtime/vm/parser.cc

Issue 2675803002: Revert "Expand _AssertionError._evaluateAssertion in the frontend" (Closed)
Patch Set: Created 3 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 48e4b9e3ca7dd8ce66381478f400bfd608dbe052..d8227bce2aa1527697d44827ad87dca3c1adc3e1 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -9441,24 +9441,13 @@ AstNode* Parser::ParseAssertStatement(bool is_const) {
ExpectToken(Token::kRPAREN);
if (!is_const) {
- if (condition->IsClosureNode()) {
- // We always have to invoke a closure node.
- InstanceCallNode* invoke_condition =
- new (Z) InstanceCallNode(condition_pos, condition, Symbols::Call(),
- new (Z) ArgumentListNode(condition_pos));
- condition = invoke_condition;
- } else if (condition->IsComparisonNode() || condition->IsUnaryOpNode()) {
- // Cannot be a function, skip type test and invocation.
- } else {
- // Check for assertion condition being a function if not const.
- ArgumentListNode* arguments = new (Z) ArgumentListNode(condition_pos);
- arguments->Add(condition);
- condition = MakeStaticCall(
- Symbols::AssertionError(),
- Library::PrivateCoreLibName(Symbols::EvaluateAssertion()), arguments);
- }
+ // Check for assertion condition being a function if not const.
+ ArgumentListNode* arguments = new (Z) ArgumentListNode(condition_pos);
+ arguments->Add(condition);
+ condition = MakeStaticCall(
+ Symbols::AssertionError(),
+ Library::PrivateCoreLibName(Symbols::EvaluateAssertion()), arguments);
}
-
AstNode* not_condition =
new (Z) UnaryOpNode(condition_pos, Token::kNOT, condition);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698