@@ -329,7 +329,7 @@ export function humanizeTemplate(template: CompiledTemplate,
|
||||
humanizedTemplates: Map<number, StringMap<string, any>> = null):
|
||||
StringMap<string, any> {
|
||||
if (isBlank(humanizedTemplates)) {
|
||||
humanizedTemplates = new Map();
|
||||
humanizedTemplates = new Map<number, StringMap<string, any>>();
|
||||
}
|
||||
var result = humanizedTemplates.get(template.id);
|
||||
if (isPresent(result)) {
|
||||
|
||||
@@ -608,7 +608,7 @@ function createProtoView(elementBinders = null, type: ViewType = null,
|
||||
type = ViewType.COMPONENT;
|
||||
}
|
||||
var pv = new AppProtoView(type, isEmbeddedFragment, new RenderProtoViewRef(), null, null,
|
||||
new Map(), null, null);
|
||||
new Map<string, number>(), null, null);
|
||||
if (isBlank(elementBinders)) {
|
||||
elementBinders = [];
|
||||
}
|
||||
@@ -703,7 +703,7 @@ class DirectiveWithAttributes {
|
||||
}
|
||||
|
||||
class FakeViewResolver extends ViewResolver {
|
||||
_cmpViews: Map<Type, ViewMetadata> = new Map();
|
||||
_cmpViews = new Map<Type, ViewMetadata>();
|
||||
|
||||
constructor() { super(); }
|
||||
|
||||
|
||||
@@ -151,11 +151,13 @@ export function main() {
|
||||
|
||||
it("should not throw when not binding to a name exported by two directives", () => {
|
||||
expect(() => {
|
||||
createDirectiveVariableBindings(new RenderElementBinder({variableBindings: new Map()}), [
|
||||
directiveBinding({metadata: RenderDirectiveMetadata.create({exportAs: 'exportName'})}),
|
||||
directiveBinding(
|
||||
{metadata: RenderDirectiveMetadata.create({exportAs: 'exportName'})})
|
||||
]);
|
||||
createDirectiveVariableBindings(
|
||||
new RenderElementBinder({variableBindings: new Map<string, string>()}), [
|
||||
directiveBinding(
|
||||
{metadata: RenderDirectiveMetadata.create({exportAs: 'exportName'})}),
|
||||
directiveBinding(
|
||||
{metadata: RenderDirectiveMetadata.create({exportAs: 'exportName'})})
|
||||
]);
|
||||
}).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -29,7 +29,7 @@ export function main() {
|
||||
}
|
||||
|
||||
function createView(pv) {
|
||||
return new AppView(null, pv, null, null, null, null, new Map(), null, null);
|
||||
return new AppView(null, pv, null, null, null, null, new Map<string, any>(), null, null);
|
||||
}
|
||||
|
||||
it('should support multiple AppProtoViews', () => {
|
||||
|
||||
@@ -183,12 +183,9 @@ export function main() {
|
||||
}
|
||||
|
||||
class FakeXHR extends XHR {
|
||||
_responses: Map<string, string>;
|
||||
_responses = new Map<string, string>();
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this._responses = new Map();
|
||||
}
|
||||
constructor() { super(); }
|
||||
|
||||
get(url: string): Promise<string> {
|
||||
var response = this._responses.get(url);
|
||||
|
||||
@@ -194,7 +194,7 @@ export function main() {
|
||||
class SomeComponent {}
|
||||
|
||||
class FakeXHR extends XHR {
|
||||
_responses: Map<string, string> = new Map();
|
||||
_responses = new Map<string, string>();
|
||||
|
||||
constructor() { super(); }
|
||||
|
||||
|
||||
@@ -95,14 +95,14 @@ export function main() {
|
||||
}
|
||||
|
||||
class FakeEventManagerPlugin extends EventManagerPlugin {
|
||||
_eventHandler: Map<string, Function> = new Map();
|
||||
_eventHandler = new Map<string, Function>();
|
||||
constructor(public _supports: string[]) { super(); }
|
||||
|
||||
supports(eventName: string): boolean { return ListWrapper.contains(this._supports, eventName); }
|
||||
|
||||
addEventListener(element, eventName: string, handler: Function) {
|
||||
this._eventHandler.set(eventName, handler);
|
||||
return () => { MapWrapper.delete(this._eventHandler, eventName) };
|
||||
return () => { MapWrapper.delete(this._eventHandler, eventName); };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ export function main() {
|
||||
describe('createRenderView', () => {
|
||||
var nodeFactory: DomNodeFactory;
|
||||
var eventDispatcher: SpyRenderEventDispatcher;
|
||||
var componentTemplates: Map<number, RenderTemplateCmd[]> = new Map();
|
||||
var componentTemplates = new Map<number, RenderTemplateCmd[]>();
|
||||
beforeEach(() => {
|
||||
nodeFactory = new DomNodeFactory(componentTemplates);
|
||||
eventDispatcher = new SpyRenderEventDispatcher();
|
||||
@@ -523,4 +523,4 @@ function mapAttrs(nodes: Node[], attrName): string[] {
|
||||
|
||||
function mapText(nodes: Node[]): string[] {
|
||||
return nodes.map(node => DOM.getText(node));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,11 +30,8 @@ var unused: Response;
|
||||
|
||||
class MockBrowserJsonp extends BrowserJsonp {
|
||||
src: string;
|
||||
callbacks: Map<string, (data: any) => any>;
|
||||
constructor() {
|
||||
super();
|
||||
this.callbacks = new Map();
|
||||
}
|
||||
callbacks = new Map<string, (data: any) => any>();
|
||||
constructor() { super(); }
|
||||
|
||||
addEventListener(type: string, cb: (data: any) => any) { this.callbacks.set(type, cb); }
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class MockBrowserXHR extends BrowserXhr {
|
||||
response: any;
|
||||
responseText: string;
|
||||
setRequestHeader: any;
|
||||
callbacks: Map<string, Function>;
|
||||
callbacks = new Map<string, Function>();
|
||||
status: number;
|
||||
constructor() {
|
||||
super();
|
||||
@@ -47,7 +47,6 @@ class MockBrowserXHR extends BrowserXhr {
|
||||
this.send = sendSpy = spy.spy('send');
|
||||
this.open = openSpy = spy.spy('open');
|
||||
this.setRequestHeader = setRequestHeaderSpy = spy.spy('setRequestHeader');
|
||||
this.callbacks = new Map();
|
||||
}
|
||||
|
||||
setStatusCode(status) { this.status = status; }
|
||||
|
||||
Reference in New Issue
Block a user