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

Unified Diff: pkg/polymer/lib/src/build/script_compactor.dart

Issue 315813003: Support using a mock SDK with the resolver in code-transformers, and switch (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | « pkg/code_transformers/test/resolver_test.dart ('k') | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/build/script_compactor.dart
diff --git a/pkg/polymer/lib/src/build/script_compactor.dart b/pkg/polymer/lib/src/build/script_compactor.dart
index b633360cb27610da7432724910bb1394b32d6a52..d11b6167149d8391c0bae83eb8ed08976b279ead 100644
--- a/pkg/polymer/lib/src/build/script_compactor.dart
+++ b/pkg/polymer/lib/src/build/script_compactor.dart
@@ -45,7 +45,47 @@ class ScriptCompactor extends Transformer {
final TransformOptions options;
ScriptCompactor(this.options, {String sdkDir})
- : resolvers = new Resolvers(sdkDir != null ? sdkDir : dartSdkDirectory);
+ // TODO(sigmund): consider restoring here a resolver that uses the real
+ // SDK once the analyzer is lazy and only an resolves what it needs:
+ //: resolvers = new Resolvers(sdkDir != null ? sdkDir : dartSdkDirectory);
+ : resolvers = new Resolvers.fromMock({
+ // The list of types below is derived from:
+ // * types we use via our smoke queries, including HtmlElement and
+ // types from `_typeHandlers` (deserialize.dart)
+ // * types that are used internally by the resolver (see
+ // _initializeFrom in resolver.dart).
+ 'dart:core': '''
+ library dart.core;
+ class Object {}
+ class Function {}
+ class StackTrace {}
+ class Symbol {}
+ class Type {}
+
+ class String extends Object {}
+ class bool extends Object {}
+ class num extends Object {}
+ class int extends num {}
+ class double extends num {}
+ class DateTime extends Object {}
+ class Null extends Object {}
+
+ class Deprecated extends Object {
+ final String expires;
+ const Deprecated(this.expires);
+ }
+ const Object deprecated = const Deprecated("next release");
+
+ class List<V> extends Object {}
+ class Map<K, V> extends Object {}
+ ''',
+ 'dart:html': '''
+ library dart.html;
+ class HtmlElement {}
+ ''',
+ });
+
+
/// Only run on entry point .html files.
// TODO(nweiz): This should just take an AssetId when barback <0.13.0 support
« no previous file with comments | « pkg/code_transformers/test/resolver_test.dart ('k') | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698