refactor(transformer): use the new compiler

Part of #3605
This commit is contained in:
Tim Blasi
2015-10-01 09:10:26 -07:00
committed by Tobias Bosch
parent a5622304de
commit 52236bd765
159 changed files with 2770 additions and 2162 deletions

View File

@ -0,0 +1,26 @@
library angular2.test.transform.common.compile_directive_metadata;
final ngFor = {
"NgFor": {
"kind": "type",
"value": {
"isComponent": false,
"dynamicLoadable": true,
"selector": "[ng-for][ng-for-of]",
"exportAs": null,
"type": {
"id": 9999,
"name": "NgFor",
"moduleUrl": "asset:angular2/lib/src/core/directives/ng_for.dart"
},
"changeDetection": null,
"properties": {"ngForOf": "ngForOf"},
"events": {},
"hostListeners": {},
"hostProperties": {},
"hostAttributes": {},
"lifecycleHooks": [2],
"template": null
}
}
};

View File

@ -1,6 +1,7 @@
library angular2.test.transform.common.annotation_matcher_test;
import 'package:angular2/src/core/render/api.dart';
import 'package:angular2/src/compiler/directive_metadata.dart';
import 'package:angular2/src/transform/common/ng_meta.dart';
import 'package:guinness/guinness.dart';
@ -8,10 +9,10 @@ main() => allTests();
void allTests() {
var mockData = [
new RenderDirectiveMetadata(id: 'm1'),
new RenderDirectiveMetadata(id: 'm2'),
new RenderDirectiveMetadata(id: 'm3'),
new RenderDirectiveMetadata(id: 'm4')
CompileDirectiveMetadata.create(type: new CompileTypeMetadata(name: 'N1')),
CompileDirectiveMetadata.create(type: new CompileTypeMetadata(name: 'N2')),
CompileDirectiveMetadata.create(type: new CompileTypeMetadata(name: 'N3')),
CompileDirectiveMetadata.create(type: new CompileTypeMetadata(name: 'N4'))
];
it('should allow empty data.', () {
@ -92,7 +93,7 @@ _checkSimilar(NgMeta a, NgMeta b) {
expect(b.types).toContain(k);
var at = a.types[k];
var bt = b.types[k];
expect(at.id).toEqual(bt.id);
expect(at.type.name).toEqual(bt.type.name);
}
for (var k in a.aliases.keys) {
expect(b.aliases).toContain(k);