Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit eee5b5e

Browse files
Ted Sanderrkirov
authored andcommitted
fix(transformers): Fix expression_spec test and dart2js tests.
Fix expression_generator_spec by removing deprecated lib syntax for relative uris, and using package syntax instead. Fix dart2js test by fixing bug in DynamicTypeToUriMapper.
1 parent 8d36167 commit eee5b5e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/core_dom/type_to_uri_mapper_dynamic.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ class DynamicTypeToUriMapper extends TypeToUriMapper {
1010
Uri uriForType(Type type) {
1111
var typeMirror = reflectType(type);
1212
LibraryMirror lib = typeMirror.owner;
13+
// LibraryMirror should produce absolute URIs but due to bug:
14+
// http://dartbug.com/22249 dart2js produces relative URIs. Change to an
15+
// absolute path.
16+
// TODO(tsander): Remove this code when bug is fixed.
17+
if (!lib.uri.isAbsolute && !lib.uri.path.startsWith('/')) {
18+
return Uri.parse('/${lib.uri.path}');
19+
}
1320
return lib.uri;
1421
}
1522
}

test/tools/transformer/expression_generator_spec.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ main() {
100100
import 'package:angular/cacheAnnotation.dart';
101101
102102
@NgTemplateCache(
103-
preCacheUrls: ['lib/foo.html', 'packages/b/bar.html'])
103+
preCacheUrls: ['packages/a/foo.html', 'packages/b/bar.html'])
104104
class FooClass {}
105105
106106
main() {}

0 commit comments

Comments
 (0)