From 526a57d16673501f81f9c4faebefc329c07ba067 Mon Sep 17 00:00:00 2001 From: Diana Salsbury Date: Mon, 25 Aug 2014 14:51:23 -0700 Subject: [PATCH] fix(transformer): Don't share resolvers between parallel transformers as this will cause a deadlock Fixes #1276 Closes #1382 Conflicts: lib/transformer.dart --- lib/transformer.dart | 21 ++++++++++++--------- pubspec.lock | 8 ++------ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lib/transformer.dart b/lib/transformer.dart index 235d9deab..55f9e4fac 100644 --- a/lib/transformer.dart +++ b/lib/transformer.dart @@ -117,20 +117,23 @@ Map _readStringMapValue(Map args, String name) { return value; } -List> _createPhases(TransformOptions options) { +Transformer _staticGenerator(TransformOptions options) { var resolvers = new Resolvers(options.sdkDirectory); - return [ - [ new HtmlDartReferencesGenerator(options) ], - [ new di.InjectorGenerator(options.diOptions, resolvers) ], - [ new _SerialTransformer([ - new TypeRelativeUriGenerator(options, resolvers), + return new _SerialTransformer([ new ExpressionGenerator(options, resolvers), new MetadataGenerator(options, resolvers), - new StaticAngularGenerator(options, resolvers) - ])] - ]; + new StaticAngularGenerator(options, resolvers), + new TypeRelativeUriGenerator(options, resolvers) + ]); } +List> _createPhases(TransformOptions options) => + [ + [ new HtmlDartReferencesGenerator(options) ], + [ new di.InjectorGenerator(options.diOptions, new Resolvers(options.sdkDirectory)) ], + [ _staticGenerator(options) ] + ]; + /// Helper which runs a group of transformers serially and ensures that /// transformers with shared data are always applied in a specific order. /// diff --git a/pubspec.lock b/pubspec.lock index 862d01955..dfcb1fa8e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -12,7 +12,7 @@ packages: barback: description: barback source: hosted - version: "0.14.1+3" + version: "0.14.0+3" benchmark_harness: description: benchmark_harness source: hosted @@ -85,14 +85,10 @@ packages: description: source_maps source: hosted version: "0.9.3" - source_span: - description: source_span - source: hosted - version: "1.0.0" stack_trace: description: stack_trace source: hosted - version: "1.0.2" + version: "0.9.3+2" typed_mock: description: typed_mock source: hosted