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

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

Issue 2851163002: Handle symbol literals in closed_world2_test (Closed)
Patch Set: Reinsert test code Created 3 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 | « tests/compiler/dart2js/mock_compiler.dart ('k') | tests/utils/dummy_compiler_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/mock_libraries.dart
diff --git a/tests/compiler/dart2js/mock_libraries.dart b/tests/compiler/dart2js/mock_libraries.dart
index 0c10523de66379564033a5b09fa47a3b0aa82862..d1b9025315241458305fc546caa4b4eca02edc6b 100644
--- a/tests/compiler/dart2js/mock_libraries.dart
+++ b/tests/compiler/dart2js/mock_libraries.dart
@@ -12,6 +12,7 @@ core:core/core.dart
async:async/async.dart
_js_helper:_internal/js_runtime/lib/js_helper.dart
_interceptors:_internal/js_runtime/lib/interceptors.dart
+_internal:internal/internal.dart
_isolate_helper:_internal/js_runtime/lib/isolate_helper.dart
""";
@@ -29,6 +30,9 @@ String buildLibrarySource(Map<String, String> elementMap,
}
const Map<String, String> DEFAULT_CORE_LIBRARY = const <String, String>{
+ '<imports>': '''
+import 'dart:_internal' as internal;
+''',
'bool': 'class bool {}',
'Comparator': 'abstract class Comparator<T> {}',
'DateTime': r'''
@@ -98,7 +102,11 @@ const Map<String, String> DEFAULT_CORE_LIBRARY = const <String, String>{
'Resource': 'class Resource {}',
'StackTrace': 'abstract class StackTrace {}',
'String': 'class String implements Pattern {}',
- 'Symbol': 'class Symbol { final _name; const Symbol(this._name); }',
+ 'Symbol': '''
+ abstract class Symbol {
+ const factory Symbol(String name) = internal.Symbol;
+ }
+ ''',
'Type': 'class Type {}',
'Pattern': 'abstract class Pattern {}',
'_genericNoSuchMethod': '_genericNoSuchMethod(a,b,c,d,e) {}',
@@ -106,6 +114,20 @@ const Map<String, String> DEFAULT_CORE_LIBRARY = const <String, String>{
'_malformedTypeError': '_malformedTypeError(message) {}',
};
+const Map<String, String> DEFAULT_INTERNAL_LIBRARY = const <String, String>{
+ '<imports>': '''
+import 'dart:core' as core;
+''',
+ 'Symbol': '''
+class Symbol implements core.Symbol {
+ final core.String _name;
+
+ const Symbol(this._name);
+ Symbol.validated(this._name);
+}
+''',
+};
+
const String DEFAULT_PATCH_CORE_SOURCE = r'''
import 'dart:_js_helper';
import 'dart:_interceptors';
« no previous file with comments | « tests/compiler/dart2js/mock_compiler.dart ('k') | tests/utils/dummy_compiler_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698