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
This commit is contained in:
Alex Eagle 2015-08-06 10:02:49 -07:00
parent f11f4e0b45
commit b4a062983b
14 changed files with 24 additions and 26 deletions

View File

@ -6,7 +6,7 @@ import {List, ListWrapper} from 'angular2/src/facade/collection';
import {Location} from 'angular2/src/router/location'; import {Location} from 'angular2/src/router/location';
@proxy() @proxy
@IMPLEMENTS(Location) @IMPLEMENTS(Location)
export class SpyLocation extends SpyObject { export class SpyLocation extends SpyObject {
urlChanges: List<string>; urlChanges: List<string>;

View File

@ -12,9 +12,7 @@ import {createTestInjector, FunctionWithParamTokens, inject} from './test_inject
export {inject} from './test_injector'; export {inject} from './test_injector';
export function proxy(): ClassDecorator { export var proxy: ClassDecorator = (t) => t;
return (t) => t;
}
var _global: jasmine.GlobalPolluter = <any>(typeof window === 'undefined' ? global : window); var _global: jasmine.GlobalPolluter = <any>(typeof window === 'undefined' ? global : window);

View File

@ -117,7 +117,7 @@ export function main() {
}); });
} }
@proxy() @proxy
@IMPLEMENTS(ChangeDetectorRef) @IMPLEMENTS(ChangeDetectorRef)
class SpyChangeDetectorRef extends SpyObject { class SpyChangeDetectorRef extends SpyObject {
constructor() { super(ChangeDetectorRef); } constructor() { super(ChangeDetectorRef); }

View File

@ -119,7 +119,7 @@ export function main() {
}); });
} }
@proxy() @proxy
@IMPLEMENTS(ChangeDetectorRef) @IMPLEMENTS(ChangeDetectorRef)
class SpyChangeDetectorRef extends SpyObject { class SpyChangeDetectorRef extends SpyObject {
constructor() { super(ChangeDetectorRef); } constructor() { super(ChangeDetectorRef); }

View File

@ -658,14 +658,14 @@ class DirectiveWithAttributes {
constructor(@Attribute('someAttr') someAttr: String) {} constructor(@Attribute('someAttr') someAttr: String) {}
} }
@proxy() @proxy
@IMPLEMENTS(RenderCompiler) @IMPLEMENTS(RenderCompiler)
class SpyRenderCompiler extends SpyObject { class SpyRenderCompiler extends SpyObject {
constructor() { super(RenderCompiler); } constructor() { super(RenderCompiler); }
noSuchMethod(m) { return super.noSuchMethod(m) } noSuchMethod(m) { return super.noSuchMethod(m) }
} }
@proxy() @proxy
@IMPLEMENTS(DirectiveResolver) @IMPLEMENTS(DirectiveResolver)
class SpyDirectiveResolver extends SpyObject { class SpyDirectiveResolver extends SpyObject {
constructor() { super(DirectiveResolver); } constructor() { super(DirectiveResolver); }

View File

@ -48,7 +48,7 @@ import {ElementRef} from 'angular2/src/core/compiler/element_ref';
import {DynamicChangeDetector, ChangeDetectorRef, Parser, Lexer} from 'angular2/src/change_detection/change_detection'; import {DynamicChangeDetector, ChangeDetectorRef, Parser, Lexer} from 'angular2/src/change_detection/change_detection';
import {QueryList} from 'angular2/src/core/compiler/query_list'; import {QueryList} from 'angular2/src/core/compiler/query_list';
@proxy() @proxy
@IMPLEMENTS(AppView) @IMPLEMENTS(AppView)
class DummyView extends SpyObject { class DummyView extends SpyObject {
changeDetector; changeDetector;
@ -59,7 +59,7 @@ class DummyView extends SpyObject {
noSuchMethod(m) { return super.noSuchMethod(m); } noSuchMethod(m) { return super.noSuchMethod(m); }
} }
@proxy() @proxy
@IMPLEMENTS(ElementRef) @IMPLEMENTS(ElementRef)
class DummyElementRef extends SpyObject { class DummyElementRef extends SpyObject {
boundElementIndex: number = 0; boundElementIndex: number = 0;

View File

@ -199,7 +199,7 @@ function createRenderViewportElementBinder(nestedProtoView) {
return new renderApi.ElementBinder({nestedProtoView: nestedProtoView}); return new renderApi.ElementBinder({nestedProtoView: nestedProtoView});
} }
@proxy() @proxy
@IMPLEMENTS(ChangeDetection) @IMPLEMENTS(ChangeDetection)
class ChangeDetectionSpy extends SpyObject { class ChangeDetectionSpy extends SpyObject {
constructor() { super(ChangeDetection); } constructor() { super(ChangeDetection); }

View File

@ -62,7 +62,7 @@ export function main() {
}); });
} }
@proxy() @proxy
@IMPLEMENTS(AppView) @IMPLEMENTS(AppView)
class AppViewSpy extends SpyObject { class AppViewSpy extends SpyObject {
viewContainers: AppViewContainer[] = [null]; viewContainers: AppViewContainer[] = [null];
@ -70,7 +70,7 @@ class AppViewSpy extends SpyObject {
noSuchMethod(m) { return super.noSuchMethod(m) } noSuchMethod(m) { return super.noSuchMethod(m) }
} }
@proxy() @proxy
@IMPLEMENTS(AppViewManager) @IMPLEMENTS(AppViewManager)
class AppViewManagerSpy extends SpyObject { class AppViewManagerSpy extends SpyObject {
constructor() { super(AppViewManager); } constructor() { super(AppViewManager); }

View File

@ -507,21 +507,21 @@ export function main() {
}); });
} }
@proxy() @proxy
@IMPLEMENTS(Renderer) @IMPLEMENTS(Renderer)
class SpyRenderer extends SpyObject { class SpyRenderer extends SpyObject {
constructor() { super(Renderer); } constructor() { super(Renderer); }
noSuchMethod(m) { return super.noSuchMethod(m) } noSuchMethod(m) { return super.noSuchMethod(m) }
} }
@proxy() @proxy
@IMPLEMENTS(AppViewPool) @IMPLEMENTS(AppViewPool)
class SpyAppViewPool extends SpyObject { class SpyAppViewPool extends SpyObject {
constructor() { super(AppViewPool); } constructor() { super(AppViewPool); }
noSuchMethod(m) { return super.noSuchMethod(m) } noSuchMethod(m) { return super.noSuchMethod(m) }
} }
@proxy() @proxy
@IMPLEMENTS(AppViewListener) @IMPLEMENTS(AppViewListener)
class SpyAppViewListener extends SpyObject { class SpyAppViewListener extends SpyObject {
constructor() { super(AppViewListener); } constructor() { super(AppViewListener); }

View File

@ -353,7 +353,7 @@ export function createEmbeddedPv(binders: ElementBinder[] = null) {
class SomeComponent { class SomeComponent {
} }
@proxy() @proxy
@IMPLEMENTS(ProtoElementInjector) @IMPLEMENTS(ProtoElementInjector)
class SpyProtoElementInjector extends SpyObject { class SpyProtoElementInjector extends SpyObject {
index: number; index: number;
@ -361,21 +361,21 @@ class SpyProtoElementInjector extends SpyObject {
noSuchMethod(m) { return super.noSuchMethod(m) } noSuchMethod(m) { return super.noSuchMethod(m) }
} }
@proxy() @proxy
@IMPLEMENTS(ElementInjector) @IMPLEMENTS(ElementInjector)
class SpyElementInjector extends SpyObject { class SpyElementInjector extends SpyObject {
constructor(public parent: ElementInjector) { super(ElementInjector); } constructor(public parent: ElementInjector) { super(ElementInjector); }
noSuchMethod(m) { return super.noSuchMethod(m) } noSuchMethod(m) { return super.noSuchMethod(m) }
} }
@proxy() @proxy
@IMPLEMENTS(PreBuiltObjects) @IMPLEMENTS(PreBuiltObjects)
class SpyPreBuiltObjects extends SpyObject { class SpyPreBuiltObjects extends SpyObject {
constructor() { super(PreBuiltObjects); } constructor() { super(PreBuiltObjects); }
noSuchMethod(m) { return super.noSuchMethod(m) } noSuchMethod(m) { return super.noSuchMethod(m) }
} }
@proxy() @proxy
@IMPLEMENTS(Injector) @IMPLEMENTS(Injector)
class SpyInjector extends SpyObject { class SpyInjector extends SpyObject {
constructor() { super(Injector); } constructor() { super(Injector); }

View File

@ -79,7 +79,7 @@ class TestComponent {
} }
@proxy() @proxy
@IMPLEMENTS(Location) @IMPLEMENTS(Location)
class DummyLocation extends SpyObject { class DummyLocation extends SpyObject {
noSuchMethod(m) { return super.noSuchMethod(m) } noSuchMethod(m) { return super.noSuchMethod(m) }
@ -92,7 +92,7 @@ function makeDummyLocation() {
} }
@proxy() @proxy
@IMPLEMENTS(Router) @IMPLEMENTS(Router)
class DummyRouter extends SpyObject { class DummyRouter extends SpyObject {
noSuchMethod(m) { return super.noSuchMethod(m) } noSuchMethod(m) { return super.noSuchMethod(m) }

View File

@ -175,7 +175,7 @@ export function main() {
}); });
} }
@proxy() @proxy
@IMPLEMENTS(RouterOutlet) @IMPLEMENTS(RouterOutlet)
class DummyOutlet extends SpyObject { class DummyOutlet extends SpyObject {
noSuchMethod(m) { return super.noSuchMethod(m) } noSuchMethod(m) { return super.noSuchMethod(m) }

View File

@ -58,7 +58,7 @@ export function main() {
}); });
} }
@proxy() @proxy
@IMPLEMENTS(ElementRef) @IMPLEMENTS(ElementRef)
class SpyElementRef extends SpyObject { class SpyElementRef extends SpyObject {
nativeElement; nativeElement;
@ -66,7 +66,7 @@ class SpyElementRef extends SpyObject {
noSuchMethod(m) { return super.noSuchMethod(m) } noSuchMethod(m) { return super.noSuchMethod(m) }
} }
@proxy() @proxy
@IMPLEMENTS(DomAdapter) @IMPLEMENTS(DomAdapter)
class SpyDomAdapter extends SpyObject { class SpyDomAdapter extends SpyObject {
constructor() { super(DomAdapter); } constructor() { super(DomAdapter); }

View File

@ -21,7 +21,7 @@ class TestObj {
someComplexFunc(a) { return a; } someComplexFunc(a) { return a; }
} }
@proxy() @proxy
@IMPLEMENTS(TestObj) @IMPLEMENTS(TestObj)
class SpyTestObj extends SpyObject { class SpyTestObj extends SpyObject {
constructor() { super(TestObj); } constructor() { super(TestObj); }