OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library test.src.serialization.elements_test; | 5 library test.src.serialization.elements_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; | 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
(...skipping 8031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8042 const dynamic a = null; | 8042 const dynamic a = null; |
8043 -------------------- | 8043 -------------------- |
8044 unit: foo.dart | 8044 unit: foo.dart |
8045 | 8045 |
8046 '''); | 8046 '''); |
8047 } | 8047 } |
8048 | 8048 |
8049 test_metadata_prefixed_variable() async { | 8049 test_metadata_prefixed_variable() async { |
8050 addLibrarySource('/a.dart', 'const b = null;'); | 8050 addLibrarySource('/a.dart', 'const b = null;'); |
8051 var library = await checkLibrary('import "a.dart" as a; @a.b class C {}'); | 8051 var library = await checkLibrary('import "a.dart" as a; @a.b class C {}'); |
8052 checkElementText(library, r''' | 8052 if (isSharedFrontEnd) { |
| 8053 checkElementText(library, r''' |
| 8054 import 'a.dart' as a; |
| 8055 @ |
| 8056 b/*location: a.dart;b?*/ |
| 8057 class C { |
| 8058 } |
| 8059 '''); |
| 8060 } else { |
| 8061 checkElementText(library, r''' |
8053 import 'a.dart' as a; | 8062 import 'a.dart' as a; |
8054 @ | 8063 @ |
8055 a/*location: test.dart;a*/. | 8064 a/*location: test.dart;a*/. |
8056 b/*location: a.dart;b?*/ | 8065 b/*location: a.dart;b?*/ |
8057 class C { | 8066 class C { |
8058 } | 8067 } |
8059 '''); | 8068 '''); |
| 8069 } |
8060 } | 8070 } |
8061 | 8071 |
8062 test_metadata_simpleFormalParameter() async { | 8072 test_metadata_simpleFormalParameter() async { |
8063 var library = await checkLibrary('const a = null; f(@a x) {}'); | 8073 var library = await checkLibrary('const a = null; f(@a x) {}'); |
8064 checkElementText(library, r''' | 8074 checkElementText(library, r''' |
8065 const dynamic a = null; | 8075 const dynamic a = null; |
8066 dynamic f(@ | 8076 dynamic f(@ |
8067 a/*location: test.dart;a?*/ dynamic x) {} | 8077 a/*location: test.dart;a?*/ dynamic x) {} |
8068 '''); | 8078 '''); |
8069 } | 8079 } |
(...skipping 1977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10047 fail('Unexpectedly tried to get unlinked summary for $uri'); | 10057 fail('Unexpectedly tried to get unlinked summary for $uri'); |
10048 } | 10058 } |
10049 return serializedUnit; | 10059 return serializedUnit; |
10050 } | 10060 } |
10051 | 10061 |
10052 @override | 10062 @override |
10053 bool hasLibrarySummary(String uri) { | 10063 bool hasLibrarySummary(String uri) { |
10054 return true; | 10064 return true; |
10055 } | 10065 } |
10056 } | 10066 } |
OLD | NEW |