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

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

Issue 2983773002: Resynthesize expressions for Kernel's StaticGet and PropertyGet. (Closed)
Patch Set: Resynthesize ClassName.StaticElement for Kernel. 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..48c6ad6ed6625f194558c8e6297ec205690ad247 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_common.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_common.dart
@@ -65,6 +65,11 @@ abstract class AbstractResynthesizeTest extends AbstractSingleUnitTest {
bool shouldCompareLibraryElements = true;
/**
+ * Return `true` if shared front-end is used.
+ */
+ bool get isSharedFrontEnd => false;
+
+ /**
* Return `true` if resynthesizing should be done is strong mode.
*/
bool get isStrongMode;
@@ -3686,10 +3691,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 +3716,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