chore(dart/transform): Create targets for serving transformed Dart code

- Allow pub (build|serve) to specify mode
- Update pubbuild.js & pubserve.js to allow the caller to provide a `mode` value.
- Update settings to allow the di benchmark to be transformed to run statically.
This commit is contained in:
Tim Blasi
2015-04-06 14:48:07 -07:00
parent 1a99090b45
commit 42c0171b40
5 changed files with 35 additions and 37 deletions

View File

@ -1,36 +1,13 @@
import {Injector, Key} from "angular2/di";
import {Injectable, Injector, Key} from "angular2/di";
import {reflector} from 'angular2/src/reflection/reflection';
import {ReflectionCapabilities} from 'angular2/src/reflection/reflection_capabilities';
import {getIntParameter, bindAction, microBenchmark} from 'angular2/src/test_lib/benchmark_util';
import {BrowserDomAdapter} from 'angular2/src/dom/browser_adapter';
var count = 0;
function setupReflector() {
reflector.registerType(A, {
'factory': () => new A(),
'parameters': [],
'annotations' : []
});
reflector.registerType(B, {
'factory': (a) => new B(a),
'parameters': [[A]],
'annotations' : []
});
reflector.registerType(C, {
'factory': (b) => new C(b),
'parameters': [[B]],
'annotations' : []
});
reflector.registerType(D, {
'factory': (c,b) => new D(c,b),
'parameters': [[C],[B]],
'annotations' : []
});
reflector.registerType(E, {
'factory': (d,c) => new E(d,c),
'parameters': [[D],[C]],
'annotations' : []
});
reflector.reflectionCapabilities = new ReflectionCapabilities();
}
export function main() {
@ -97,31 +74,35 @@ export function main() {
@Injectable()
class A {
constructor() {
count++;
}
}
@Injectable()
class B {
constructor(a:A) {
count++;
}
}
@Injectable()
class C {
constructor(b:B) {
count++;
}
}
@Injectable()
class D {
constructor(c:C, b:B) {
count++;
}
}
@Injectable()
class E {
constructor(d:D, c:C) {
count++;