perf(dart/transform) Restructure transform to independent phases
Update summary: - Removes the need for resolution, gaining transform speed at the cost of some precision and ability to detect errors - Generates type registrations in the package alongside their declarations - Ensures that line numbers do not change in transformed user code
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
library angular2.src.transform.common.logging;
|
||||
|
||||
import 'package:barback/barback.dart';
|
||||
import 'package:code_transformers/messages/build_logger.dart';
|
||||
|
||||
BuildLogger _logger;
|
||||
|
||||
/// Prepares [logger] for use throughout the transformer.
|
||||
void init(Transform t) {
|
||||
_logger = new BuildLogger(t);
|
||||
}
|
||||
|
||||
/// The logger the transformer should use for messaging.
|
||||
BuildLogger get logger {
|
||||
if (_logger == null) {
|
||||
throw new StateError('Logger never initialized.');
|
||||
}
|
||||
return _logger;
|
||||
}
|
||||
Reference in New Issue
Block a user