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

Unified Diff: pkg/compiler/lib/src/resolution/send_structure.dart

Issue 1346093003: Revert "Add optional message to assert in Dart2js - continued" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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: pkg/compiler/lib/src/resolution/send_structure.dart
diff --git a/pkg/compiler/lib/src/resolution/send_structure.dart b/pkg/compiler/lib/src/resolution/send_structure.dart
index a427db9df015cfff3274a212e9d78111f40e4028..6cef7eb06bbd1ba5366e2992a14951b04cb944b5 100644
--- a/pkg/compiler/lib/src/resolution/send_structure.dart
+++ b/pkg/compiler/lib/src/resolution/send_structure.dart
@@ -35,6 +35,35 @@ abstract class SendStructure<R, A> extends SemanticSendStructure<R, A> {
R dispatch(SemanticSendVisitor<R, A> visitor, Send send, A arg);
}
+/// The structure for a [Send] of the form `assert(e)`.
+class AssertStructure<R, A> implements SendStructure<R, A> {
+ const AssertStructure();
+
+ R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
+ return visitor.visitAssert(
+ node,
+ node.arguments.single,
+ arg);
+ }
+
+ String toString() => 'assert';
+}
+
+/// The structure for a [Send] of the form an `assert` with less or more than
+/// one argument.
+class InvalidAssertStructure<R, A> implements SendStructure<R, A> {
+ const InvalidAssertStructure();
+
+ R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
+ return visitor.errorInvalidAssert(
+ node,
+ node.argumentsNode,
+ arg);
+ }
+
+ String toString() => 'invalid assert';
+}
+
/// The structure for a [Send] of the form `a ?? b`.
class IfNullStructure<R, A> implements SendStructure<R, A> {
const IfNullStructure();
« no previous file with comments | « pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart ('k') | pkg/compiler/lib/src/resolution/tree_elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698