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

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

Issue 1261623002: Add AccessSemantics.INVALID for invalid expressions. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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
Index: tests/compiler/dart2js/semantic_visitor_test_send_data.dart
diff --git a/tests/compiler/dart2js/semantic_visitor_test_send_data.dart b/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
index 9a420d67850b0a98780468ecb09ffbb37f175785..dfcfda9319d756df7e2a76c45171320d51eabd8d 100644
--- a/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
+++ b/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
@@ -268,8 +268,8 @@ const Map<String, List<Test>> SEND_TESTS = const {
class C {}
m() => C.this(null, 42);
''',
- const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE,
- name: 'this', arguments: '(null,42)')),
+ const Visit(VisitKind.ERROR_INVALID_INVOKE,
+ error: MessageKind.THIS_PROPERTY, arguments: '(null,42)')),
// TODO(johnniwinther): Expect [VISIT_FINAL_STATIC_FIELD_SET] instead.
const Test(
'''
@@ -744,6 +744,12 @@ const Map<String, List<Test>> SEND_TESTS = const {
name: 'o'),
],
isDeferred: true),
+ const Test.prefix(
+ '''
+ ''',
+ 'm() => p;',
+ const Visit(VisitKind.ERROR_INVALID_GET,
+ error: MessageKind.PREFIX_AS_EXPRESSION)),
const Test(
'''
var o;
@@ -956,6 +962,45 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE,
name: 'o',
arguments: '(null,42)')),
+ const Test.prefix(
+ '''
+ o(a, b) {}
+ ''',
+ 'm() => p.o(null, 42);',
+ const [
+ const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS,
+ element: 'prefix(p)'),
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INVOKE,
+ element: 'function(o)',
+ arguments: '(null,42)'),
+ ],
+ isDeferred: true),
+ const Test.prefix(
+ '''
+ ''',
+ 'm() => p.o(null, 42);',
+ const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE,
+ name: 'o',
+ arguments: '(null,42)')),
+ const Test.prefix(
+ '''
+ ''',
+ 'm() => p.o(null, 42);',
+ const [
+ const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS,
+ element: 'prefix(p)'),
+ const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE,
+ name: 'o',
+ arguments: '(null,42)'),
+ ],
+ isDeferred: true),
+ const Test.prefix(
+ '''
+ ''',
+ 'm() => p(null, 42);',
+ const Visit(VisitKind.ERROR_INVALID_INVOKE,
+ error: MessageKind.PREFIX_AS_EXPRESSION,
+ arguments: '(null,42)')),
// TODO(johnniwinther): Expect [VISIT_TOP_LEVEL_FUNCTION_SET] instead.
const Test(
'''
« no previous file with comments | « tests/compiler/dart2js/semantic_visitor_test.dart ('k') | tests/compiler/dart2js/semantic_visitor_test_send_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698