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

Unified Diff: pkg/analyzer/test/src/summary/resynthesize_common.dart

Issue 2983773002: Resynthesize expressions for Kernel's StaticGet and PropertyGet. (Closed)
Patch Set: Created 3 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: pkg/analyzer/test/src/summary/resynthesize_common.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_common.dart b/pkg/analyzer/test/src/summary/resynthesize_common.dart
index c7c4c895252bf5b033439c781398343b2087cb29..a64639106df7cc0186fcffa08a2d51ecc0f340db 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_common.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_common.dart
@@ -69,6 +69,11 @@ abstract class AbstractResynthesizeTest extends AbstractSingleUnitTest {
*/
bool get isStrongMode;
+ /**
+ * Return `true` if shared front-end is used.
+ */
+ bool get isSharedFrontEnd => false;
+
void addLibrary(String uri) {
otherLibrarySources.add(context.sourceFactory.forUri(uri));
}
@@ -3599,7 +3604,17 @@ class C {
const int v = C.F.length;
''');
if (isStrongMode) {
- checkElementText(library, r'''
+ if (isSharedFrontEnd) {
+ checkElementText(library, r'''
+class C {
+ static const String F = '';
+}
+const int v =
+ F/*location: test.dart;C;F?*/.
Paul Berry 2017/07/18 18:00:14 I'm ok with not resynthesizing identifiers associa
scheglov 2017/07/18 19:01:11 Done.
+ length/*location: dart:core;String;length?*/;
+''');
+ } else {
+ checkElementText(library, r'''
class C {
static const String F = '';
}
@@ -3608,6 +3623,7 @@ const int v =
F/*location: test.dart;C;F?*/.
length/*location: dart:core;String;length?*/;
''');
+ }
} else {
checkElementText(library, r'''
class C {
@@ -3686,10 +3702,17 @@ const int v =
const v = 'abc'.length;
''');
if (isStrongMode) {
- checkElementText(library, r'''
+ if (isSharedFrontEnd) {
+ checkElementText(library, r'''
+const int v = 'abc'.
+ length/*location: dart:core;String;length?*/;
+''');
+ } else {
+ checkElementText(library, r'''
const dynamic v/*error: instanceGetter*/ = 'abc'.
length/*location: dart:core;String;length?*/;
''');
+ }
} else {
checkElementText(library, r'''
const dynamic v = 'abc'.
@@ -3704,12 +3727,21 @@ const String S = 'abc';
const v = S.length;
''');
if (isStrongMode) {
- checkElementText(library, r'''
+ if (isSharedFrontEnd) {
+ checkElementText(library, r'''
+const String S = 'abc';
+const int v =
+ S/*location: test.dart;S?*/.
+ length/*location: dart:core;String;length?*/;
+''');
+ } else {
+ checkElementText(library, r'''
const String S = 'abc';
const dynamic v/*error: instanceGetter*/ =
S/*location: test.dart;S?*/.
length/*location: dart:core;String;length?*/;
''');
+ }
} else {
checkElementText(library, r'''
const String S = 'abc';
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698