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

Unified Diff: tests/compiler/dart2js/semantic_visitor_test.dart

Issue 1108783003: Refactor SsaBuilder.visitSuperSend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 5 years, 8 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 | « pkg/compiler/lib/src/ssa/builder.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/semantic_visitor_test.dart
diff --git a/tests/compiler/dart2js/semantic_visitor_test.dart b/tests/compiler/dart2js/semantic_visitor_test.dart
index 9e8dc9bd17330061e301e408c9c7d8da03779aad..402ec30e54dd149bdad4e9bf6ae7f089f0089bd2 100644
--- a/tests/compiler/dart2js/semantic_visitor_test.dart
+++ b/tests/compiler/dart2js/semantic_visitor_test.dart
@@ -814,8 +814,17 @@ const Map<String, List<Test>> SEND_TESTS = const {
}
''',
const Visit(VisitKind.VISIT_SUPER_FIELD_INVOKE,
- element: 'field(B#o)',
- arguments: '(null,42)')),
+ element: 'field(B#o)',
+ arguments: '(null,42)')),
+ const Test.clazz(
+ '''
+ class B {
+ }
+ class C extends B {
+ m() => super.o;
+ }
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GET)),
],
'Super properties': const [
// Super properties
@@ -880,6 +889,28 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Visit(VisitKind.VISIT_SUPER_METHOD_INVOKE,
element: 'function(B#o)',
arguments: '(null,42)')),
+ const Test.clazz(
+ '''
+ class B {
+ o(a, b) {}
+ }
+ class C extends B {
+ m() { super.o(null); }
+ }
+ ''',
+ const Visit(VisitKind.VISIT_SUPER_METHOD_INCOMPATIBLE_INVOKE,
+ element: 'function(B#o)',
+ arguments: '(null)')),
+ const Test.clazz(
+ '''
+ class B {
+ }
+ class C extends B {
+ m() => super.o(null, 42);
+ }
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INVOKE,
+ arguments: '(null,42)')),
],
'Expression invoke': const [
// Expression invoke
@@ -1119,6 +1150,16 @@ const Map<String, List<Test>> SEND_TESTS = const {
element: 'function(B#+)',
operator: '+',
right: '42')),
+ const Test.clazz(
+ '''
+ class B {}
+ class C extends B {
+ m() => super + 42;
+ }
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_BINARY,
+ operator: '+',
+ right: '42')),
],
'Index': const [
// Index
@@ -1155,6 +1196,16 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Test.clazz(
'''
class B {
+ }
+ class C extends B {
+ m() => super[42];
+ }
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INDEX,
+ index: '42')),
+ const Test.clazz(
+ '''
+ class B {
operator [](_) => null;
operator []=(a, b) {}
}
@@ -1254,6 +1305,16 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Test.clazz(
'''
class B {
+ }
+ class C extends B {
+ m() => -super;
+ }
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_UNARY,
+ operator: '-')),
+ const Test.clazz(
+ '''
+ class B {
operator ~() => null;
}
class C extends B {
@@ -3619,11 +3680,24 @@ class SemanticSendTestVisitor extends SemanticTestVisitor {
Node argument,
arg) {
visits.add(new Visit(VisitKind.VISIT_SUPER_BINARY,
- element: function, operator: operator, right: argument));
+ element: function, operator: operator, right: argument));
apply(argument, arg);
}
@override
+ visitUnresolvedSuperBinary(
+ Send node,
+ Element element,
+ BinaryOperator operator,
+ Node argument,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_BINARY,
+ operator: operator, right: argument));
+ apply(argument, arg);
+ }
+
+
+ @override
visitSuperIndex(
Send node,
FunctionElement function,
@@ -3635,6 +3709,17 @@ class SemanticSendTestVisitor extends SemanticTestVisitor {
}
@override
+ visitUnresolvedSuperIndex(
+ Send node,
+ Element element,
+ Node index,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INDEX,
+ index: index));
+ apply(index, arg);
+ }
+
+ @override
visitSuperNotEquals(
Send node,
FunctionElement function,
@@ -3868,6 +3953,14 @@ class SemanticSendTestVisitor extends SemanticTestVisitor {
}
@override
+ visitUnresolvedSuperGet(
+ Send node,
+ Element element,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GET));
+ }
+
+ @override
visitSuperFieldInvoke(
Send node,
FieldElement field,
@@ -3880,6 +3973,18 @@ class SemanticSendTestVisitor extends SemanticTestVisitor {
}
@override
+ visitUnresolvedSuperInvoke(
+ Send node,
+ Element element,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INVOKE,
+ arguments: arguments));
+ apply(arguments, arg);
+ }
+
+ @override
visitSuperFieldSet(
SendSet node,
FieldElement field,
@@ -3911,6 +4016,18 @@ class SemanticSendTestVisitor extends SemanticTestVisitor {
}
@override
+ visitSuperMethodIncompatibleInvoke(
+ Send node,
+ MethodElement method,
+ NodeList arguments,
+ CallStructure callStructure,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_INCOMPATIBLE_INVOKE,
+ element: method, arguments: arguments));
+ apply(arguments, arg);
+ }
+
+ @override
visitSuperGetterGet(
Send node,
FunctionElement getter,
@@ -3952,6 +4069,16 @@ class SemanticSendTestVisitor extends SemanticTestVisitor {
}
@override
+ visitUnresolvedSuperUnary(
+ Send node,
+ UnaryOperator operator,
+ Element element,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_UNARY,
+ operator: operator));
+ }
+
+ @override
visitEquals(
Send node,
Node left,
@@ -5003,16 +5130,6 @@ class SemanticSendTestVisitor extends SemanticTestVisitor {
}
@override
- errorUnresolvedSuperBinary(
- Send node,
- ErroneousElement element,
- BinaryOperator operator,
- Node argument,
- arg) {
- // TODO: implement errorUnresolvedSuperBinary
- }
-
- @override
errorUnresolvedSuperCompoundIndexSet(
Send node,
ErroneousElement element,
@@ -5034,24 +5151,6 @@ class SemanticSendTestVisitor extends SemanticTestVisitor {
}
@override
- errorUnresolvedSuperUnary(
- Send node,
- UnaryOperator operator,
- ErroneousElement element,
- arg) {
- // TODO: implement errorUnresolvedSuperUnary
- }
-
- @override
- errorUnresolvedSuperIndex(
- Send node,
- Element element,
- Node index,
- arg) {
- // TODO: implement errorUnresolvedSuperIndex
- }
-
- @override
errorUnresolvedSuperIndexPostfix(
Send node,
Element function,
@@ -6000,6 +6099,10 @@ enum VisitKind {
VISIT_SUPER_METHOD_GET,
VISIT_SUPER_METHOD_INVOKE,
+ VISIT_SUPER_METHOD_INCOMPATIBLE_INVOKE,
+
+ VISIT_UNRESOLVED_SUPER_GET,
+ VISIT_UNRESOLVED_SUPER_INVOKE,
VISIT_BINARY,
VISIT_INDEX,
@@ -6009,7 +6112,9 @@ enum VisitKind {
VISIT_INDEX_POSTFIX,
VISIT_SUPER_BINARY,
+ VISIT_UNRESOLVED_SUPER_BINARY,
VISIT_SUPER_INDEX,
+ VISIT_UNRESOLVED_SUPER_INDEX,
VISIT_SUPER_EQUALS,
VISIT_SUPER_NOT_EQUALS,
VISIT_SUPER_INDEX_PREFIX,
@@ -6017,6 +6122,7 @@ enum VisitKind {
VISIT_UNARY,
VISIT_SUPER_UNARY,
+ VISIT_UNRESOLVED_SUPER_UNARY,
VISIT_NOT,
VISIT_EXPRESSION_INVOKE,
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698