X Tutup
Skip to content

Commit b4a0629

Browse files
committed
fix(dart): @Proxy is a value, not a factory
Previously I added parens everywhere to make this @Proxy() because our typing indicated it was a function that returned a decorator, but this breaks dart. Instead, the typing needs to be changed. Fixes #3494
1 parent f11f4e0 commit b4a0629

File tree

14 files changed

+24
-26
lines changed

14 files changed

+24
-26
lines changed

modules/angular2/src/mock/location_mock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {List, ListWrapper} from 'angular2/src/facade/collection';
66
import {Location} from 'angular2/src/router/location';
77

88

9-
@proxy()
9+
@proxy
1010
@IMPLEMENTS(Location)
1111
export class SpyLocation extends SpyObject {
1212
urlChanges: List<string>;

modules/angular2/src/test_lib/test_lib.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ import {createTestInjector, FunctionWithParamTokens, inject} from './test_inject
1212

1313
export {inject} from './test_injector';
1414

15-
export function proxy(): ClassDecorator {
16-
return (t) => t;
17-
}
15+
export var proxy: ClassDecorator = (t) => t;
1816

1917
var _global: jasmine.GlobalPolluter = <any>(typeof window === 'undefined' ? global : window);
2018

modules/angular2/test/change_detection/pipes/observable_pipe_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export function main() {
117117
});
118118
}
119119

120-
@proxy()
120+
@proxy
121121
@IMPLEMENTS(ChangeDetectorRef)
122122
class SpyChangeDetectorRef extends SpyObject {
123123
constructor() { super(ChangeDetectorRef); }

modules/angular2/test/change_detection/pipes/promise_pipe_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export function main() {
119119
});
120120
}
121121

122-
@proxy()
122+
@proxy
123123
@IMPLEMENTS(ChangeDetectorRef)
124124
class SpyChangeDetectorRef extends SpyObject {
125125
constructor() { super(ChangeDetectorRef); }

modules/angular2/test/core/compiler/compiler_spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,14 +658,14 @@ class DirectiveWithAttributes {
658658
constructor(@Attribute('someAttr') someAttr: String) {}
659659
}
660660

661-
@proxy()
661+
@proxy
662662
@IMPLEMENTS(RenderCompiler)
663663
class SpyRenderCompiler extends SpyObject {
664664
constructor() { super(RenderCompiler); }
665665
noSuchMethod(m) { return super.noSuchMethod(m) }
666666
}
667667

668-
@proxy()
668+
@proxy
669669
@IMPLEMENTS(DirectiveResolver)
670670
class SpyDirectiveResolver extends SpyObject {
671671
constructor() { super(DirectiveResolver); }

modules/angular2/test/core/compiler/element_injector_spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import {ElementRef} from 'angular2/src/core/compiler/element_ref';
4848
import {DynamicChangeDetector, ChangeDetectorRef, Parser, Lexer} from 'angular2/src/change_detection/change_detection';
4949
import {QueryList} from 'angular2/src/core/compiler/query_list';
5050

51-
@proxy()
51+
@proxy
5252
@IMPLEMENTS(AppView)
5353
class DummyView extends SpyObject {
5454
changeDetector;
@@ -59,7 +59,7 @@ class DummyView extends SpyObject {
5959
noSuchMethod(m) { return super.noSuchMethod(m); }
6060
}
6161

62-
@proxy()
62+
@proxy
6363
@IMPLEMENTS(ElementRef)
6464
class DummyElementRef extends SpyObject {
6565
boundElementIndex: number = 0;

modules/angular2/test/core/compiler/proto_view_factory_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ function createRenderViewportElementBinder(nestedProtoView) {
199199
return new renderApi.ElementBinder({nestedProtoView: nestedProtoView});
200200
}
201201

202-
@proxy()
202+
@proxy
203203
@IMPLEMENTS(ChangeDetection)
204204
class ChangeDetectionSpy extends SpyObject {
205205
constructor() { super(ChangeDetection); }

modules/angular2/test/core/compiler/view_container_ref_spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ export function main() {
6262
});
6363
}
6464

65-
@proxy()
65+
@proxy
6666
@IMPLEMENTS(AppView)
6767
class AppViewSpy extends SpyObject {
6868
viewContainers: AppViewContainer[] = [null];
6969
constructor() { super(AppView); }
7070
noSuchMethod(m) { return super.noSuchMethod(m) }
7171
}
7272

73-
@proxy()
73+
@proxy
7474
@IMPLEMENTS(AppViewManager)
7575
class AppViewManagerSpy extends SpyObject {
7676
constructor() { super(AppViewManager); }

modules/angular2/test/core/compiler/view_manager_spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,21 +507,21 @@ export function main() {
507507
});
508508
}
509509

510-
@proxy()
510+
@proxy
511511
@IMPLEMENTS(Renderer)
512512
class SpyRenderer extends SpyObject {
513513
constructor() { super(Renderer); }
514514
noSuchMethod(m) { return super.noSuchMethod(m) }
515515
}
516516

517-
@proxy()
517+
@proxy
518518
@IMPLEMENTS(AppViewPool)
519519
class SpyAppViewPool extends SpyObject {
520520
constructor() { super(AppViewPool); }
521521
noSuchMethod(m) { return super.noSuchMethod(m) }
522522
}
523523

524-
@proxy()
524+
@proxy
525525
@IMPLEMENTS(AppViewListener)
526526
class SpyAppViewListener extends SpyObject {
527527
constructor() { super(AppViewListener); }

modules/angular2/test/core/compiler/view_manager_utils_spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,29 +353,29 @@ export function createEmbeddedPv(binders: ElementBinder[] = null) {
353353
class SomeComponent {
354354
}
355355

356-
@proxy()
356+
@proxy
357357
@IMPLEMENTS(ProtoElementInjector)
358358
class SpyProtoElementInjector extends SpyObject {
359359
index: number;
360360
constructor(public parent: ProtoElementInjector) { super(ProtoElementInjector); }
361361
noSuchMethod(m) { return super.noSuchMethod(m) }
362362
}
363363

364-
@proxy()
364+
@proxy
365365
@IMPLEMENTS(ElementInjector)
366366
class SpyElementInjector extends SpyObject {
367367
constructor(public parent: ElementInjector) { super(ElementInjector); }
368368
noSuchMethod(m) { return super.noSuchMethod(m) }
369369
}
370370

371-
@proxy()
371+
@proxy
372372
@IMPLEMENTS(PreBuiltObjects)
373373
class SpyPreBuiltObjects extends SpyObject {
374374
constructor() { super(PreBuiltObjects); }
375375
noSuchMethod(m) { return super.noSuchMethod(m) }
376376
}
377377

378-
@proxy()
378+
@proxy
379379
@IMPLEMENTS(Injector)
380380
class SpyInjector extends SpyObject {
381381
constructor() { super(Injector); }

0 commit comments

Comments
 (0)
X Tutup