diff --git a/modules/angular2/src/core/annotations_impl/annotations.ts b/modules/angular2/src/core/annotations_impl/annotations.ts index 32b9b4768a..b280fbb64b 100644 --- a/modules/angular2/src/core/annotations_impl/annotations.ts +++ b/modules/angular2/src/core/annotations_impl/annotations.ts @@ -752,29 +752,20 @@ export class Directive extends Injectable { hostInjector: List; constructor({ - selector, - properties, - events, - hostListeners, - hostProperties, - hostAttributes, - hostActions, - lifecycle, - hostInjector, - compileChildren = true, - }:{ - selector?:string, - properties?:any, - events?:List, - hostListeners?: StringMap, - hostProperties?: StringMap, - hostAttributes?: StringMap, - hostActions?: StringMap, - lifecycle?:List, - hostInjector?:List, - compileChildren?:boolean - }={}) - { + selector, properties, events, hostListeners, hostProperties, hostAttributes, + hostActions, lifecycle, hostInjector, compileChildren = true, + }: { + selector?: string, + properties?: any, + events?: List, + hostListeners?: StringMap, + hostProperties?: StringMap, + hostAttributes?: StringMap, + hostActions?: StringMap, + lifecycle?: List, + hostInjector?: List, + compileChildren?: boolean + } = {}) { super(); this.selector = selector; this.properties = properties; @@ -995,36 +986,23 @@ export class Component extends Directive { */ viewInjector: List; - constructor({ - selector, - properties, - events, - hostListeners, - hostProperties, - hostAttributes, - hostActions, - appInjector, - lifecycle, - hostInjector, - viewInjector, - changeDetection = DEFAULT, - compileChildren = true - }:{ - selector?:string, - properties?:Object, - events?:List, - hostListeners?:Map, - hostProperties?:any, - hostAttributes?:any, - hostActions?:any, - appInjector?:List, - lifecycle?:List, - hostInjector?:List, - viewInjector?:List, - changeDetection?:string, - compileChildren?:boolean - }={}) - { + constructor({selector, properties, events, hostListeners, hostProperties, hostAttributes, + hostActions, appInjector, lifecycle, hostInjector, viewInjector, + changeDetection = DEFAULT, compileChildren = true}: { + selector?: string, + properties?: Object, + events?: List, + hostListeners?: Map, + hostProperties?: any, + hostAttributes?: any, + hostActions?: any, + appInjector?: List, + lifecycle?: List, + hostInjector?: List, + viewInjector?: List, + changeDetection?: string, + compileChildren?: boolean + } = {}) { super({ selector: selector, properties: properties, diff --git a/modules/angular2/src/core/annotations_impl/view.ts b/modules/angular2/src/core/annotations_impl/view.ts index cd8c910c4f..c2a005d9e3 100644 --- a/modules/angular2/src/core/annotations_impl/view.ts +++ b/modules/angular2/src/core/annotations_impl/view.ts @@ -84,18 +84,12 @@ export class View { */ renderer: string; - constructor({ - templateUrl, - template, - directives, - renderer - }: { - templateUrl?: string, - template?: string, - directives?: List>, - renderer?: string - } = {}) - { + constructor({templateUrl, template, directives, renderer}: { + templateUrl?: string, + template?: string, + directives?: List>, + renderer?: string + } = {}) { this.templateUrl = templateUrl; this.template = template; this.directives = directives; diff --git a/modules/angular2/src/di/binding.ts b/modules/angular2/src/di/binding.ts index 1bfb27c699..8ea77541c0 100644 --- a/modules/angular2/src/di/binding.ts +++ b/modules/angular2/src/di/binding.ts @@ -196,8 +196,13 @@ export class Binding { dependencies: List; constructor(token, {toClass, toValue, toAlias, toFactory, toAsyncFactory, deps}: { - toClass ?: Type, toValue ?: any, toAlias ?: any, toFactory ?: Function, - toAsyncFactory ?: Function, deps ?: List}) { + toClass?: Type, + toValue?: any, + toAlias?: any, + toFactory?: Function, + toAsyncFactory?: Function, + deps?: List + }) { this.token = token; this.toClass = toClass; this.toValue = toValue; diff --git a/modules/angular2/src/facade/lang.ts b/modules/angular2/src/facade/lang.ts index 4fcc90e7ae..49aba2896d 100644 --- a/modules/angular2/src/facade/lang.ts +++ b/modules/angular2/src/facade/lang.ts @@ -2,7 +2,7 @@ var _global: BrowserNodeGlobal = (typeof window === 'undefined' ? global : export {_global as global}; export var Type = Function; -export type Type = new (... args: any[]) => any; +export type Type = new (...args: any[]) => any; export class BaseException extends Error { message; @@ -116,7 +116,7 @@ export class StringWrapper { } static replaceAllMapped(s: string, from: RegExp, cb: Function): string { - return s.replace(from, function(... matches) { + return s.replace(from, function(...matches) { // Remove offset & string from the result array matches.splice(-2, 2); // The callback receives match, p1, ..., pn diff --git a/modules/angular2/src/render/api.ts b/modules/angular2/src/render/api.ts index 302516f428..2365c58913 100644 --- a/modules/angular2/src/render/api.ts +++ b/modules/angular2/src/render/api.ts @@ -44,17 +44,19 @@ export class ElementBinder { textBindings: List; readAttributes: Map; - constructor({ - index, parentIndex, distanceToParent, - directives, nestedProtoView, - propertyBindings, variableBindings, - eventBindings, textBindings, - readAttributes - }:{index?:number, parentIndex?:number, distanceToParent?:number, - directives?:List, nestedProtoView?:ProtoViewDto, - propertyBindings?:Map, variableBindings?:Map, - eventBindings?:List, textBindings?:List, - readAttributes?:Map}={}) { + constructor({index, parentIndex, distanceToParent, directives, nestedProtoView, propertyBindings, + variableBindings, eventBindings, textBindings, readAttributes}: { + index?: number, + parentIndex?: number, + distanceToParent?: number, + directives?: List, + nestedProtoView?: ProtoViewDto, + propertyBindings?: Map, + variableBindings?: Map, + eventBindings?: List, + textBindings?: List, + readAttributes?: Map + } = {}) { this.index = index; this.parentIndex = parentIndex; this.distanceToParent = distanceToParent; @@ -77,11 +79,11 @@ export class DirectiveBinder { // with a local name eventBindings: List; hostPropertyBindings: Map; - constructor({ - directiveIndex, propertyBindings, eventBindings, hostPropertyBindings - }:{ - directiveIndex?:number, propertyBindings?:Map, - eventBindings?:List, hostPropertyBindings?:Map + constructor({directiveIndex, propertyBindings, eventBindings, hostPropertyBindings}: { + directiveIndex?: number, + propertyBindings?: Map, + eventBindings?: List, + hostPropertyBindings?: Map }) { this.directiveIndex = directiveIndex; this.propertyBindings = propertyBindings; @@ -107,12 +109,12 @@ export class ProtoViewDto { variableBindings: Map; type: number; - constructor({ - render, elementBinders, variableBindings, type - }:{ - render?:RenderProtoViewRef, elementBinders?:List, - variableBindings?:Map, type?:number - }) { + constructor({render, elementBinders, variableBindings, type}: { + render?: RenderProtoViewRef, + elementBinders?: List, + variableBindings?: Map, + type?: number + }) { this.render = render; this.elementBinders = elementBinders; this.variableBindings = variableBindings; @@ -138,17 +140,25 @@ export class DirectiveMetadata { callOnChange: boolean; callOnAllChangesDone: boolean; changeDetection: string; - constructor({ - id, selector, compileChildren, events, hostListeners, hostProperties, - hostAttributes, hostActions, properties, readAttributes, type, - callOnDestroy, callOnChange, callOnAllChangesDone, - changeDetection - }:{ - id?:string, selector?:string, compileChildren?:boolean, events?:List, hostListeners?:Map, hostProperties?:Map, - hostAttributes?:Map, hostActions?:Map, properties?:Map, readAttributes?:List, type?:number, - callOnDestroy?:boolean, callOnChange?:boolean, callOnAllChangesDone?:boolean, - changeDetection?:string - }) { + constructor({id, selector, compileChildren, events, hostListeners, hostProperties, hostAttributes, + hostActions, properties, readAttributes, type, callOnDestroy, callOnChange, + callOnAllChangesDone, changeDetection}: { + id?: string, + selector?: string, + compileChildren?: boolean, + events?: List, + hostListeners?: Map, + hostProperties?: Map, + hostAttributes?: Map, + hostActions?: Map, + properties?: Map, + readAttributes?: List, + type?: number, + callOnDestroy?: boolean, + callOnChange?: boolean, + callOnAllChangesDone?: boolean, + changeDetection?: string + }) { this.id = id; this.selector = selector; this.compileChildren = isPresent(compileChildren) ? compileChildren : true; @@ -179,11 +189,12 @@ export class ViewDefinition { template: string; directives: List; - constructor({ - componentId, absUrl, template, directives - }:{ - componentId?:string, absUrl?:string, template?:string, directives?:List - }) { + constructor({componentId, absUrl, template, directives}: { + componentId?: string, + absUrl?: string, + template?: string, + directives?: List + }) { this.componentId = componentId; this.absUrl = absUrl; this.template = template; diff --git a/modules/angular2/src/render/dom/view/element_binder.ts b/modules/angular2/src/render/dom/view/element_binder.ts index e23ce87213..248a8844eb 100644 --- a/modules/angular2/src/render/dom/view/element_binder.ts +++ b/modules/angular2/src/render/dom/view/element_binder.ts @@ -16,19 +16,9 @@ export class ElementBinder { propertySetters: Map; hostActions: Map; - constructor({ - textNodeIndices, - contentTagSelector, - nestedProtoView, - componentId, - eventLocals, - localEvents, - globalEvents, - hostActions, - parentIndex, - distanceToParent, - propertySetters - }:{ + constructor({textNodeIndices, contentTagSelector, nestedProtoView, componentId, eventLocals, + localEvents, globalEvents, hostActions, parentIndex, distanceToParent, + propertySetters}: { contentTagSelector?: string, textNodeIndices?: List, nestedProtoView?: protoViewModule.DomProtoView, @@ -36,8 +26,8 @@ export class ElementBinder { localEvents?: List, globalEvents?: List, componentId?: string, - parentIndex?:number, - distanceToParent?:number, + parentIndex?: number, + distanceToParent?: number, propertySetters?: Map, hostActions?: Map } = {}) { diff --git a/modules/angular2/src/test_lib/test_bed.ts b/modules/angular2/src/test_lib/test_bed.ts index d6cb58cebe..0f4312d354 100644 --- a/modules/angular2/src/test_lib/test_bed.ts +++ b/modules/angular2/src/test_lib/test_bed.ts @@ -77,8 +77,8 @@ export class TestBed { * @return {Promise} */ createView(component: Type, - {context = null, - html = null}: {context?: any, html?: string} = {}): Promise { + {context = null, html = null}: {context?: any, + html?: string} = {}): Promise { if (isBlank(component) && isBlank(context)) { throw new BaseException('You must specified at least a component or a context'); } diff --git a/modules/angular2/src/test_lib/test_lib.ts b/modules/angular2/src/test_lib/test_lib.ts index 727dd3f956..ef4e8f768a 100644 --- a/modules/angular2/src/test_lib/test_lib.ts +++ b/modules/angular2/src/test_lib/test_lib.ts @@ -72,25 +72,25 @@ class BeforeEachRunner { // Reset the test bindings before each test jsmBeforeEach(() => { testBindings = []; }); -function _describe(jsmFn, ... args) { +function _describe(jsmFn, ...args) { var parentRunner = runnerStack.length === 0 ? null : runnerStack[runnerStack.length - 1]; var runner = new BeforeEachRunner(parentRunner); runnerStack.push(runner); - var suite = jsmFn(... args); + var suite = jsmFn(...args); runnerStack.pop(); return suite; } -export function describe(... args) { - return _describe(jsmDescribe, ... args); +export function describe(...args) { + return _describe(jsmDescribe, ...args); } -export function ddescribe(... args) { - return _describe(jsmDDescribe, ... args); +export function ddescribe(...args) { + return _describe(jsmDDescribe, ...args); } -export function xdescribe(... args) { - return _describe(jsmXDescribe, ... args); +export function xdescribe(...args) { + return _describe(jsmXDescribe, ...args); } export function beforeEach(fn) { @@ -123,7 +123,7 @@ export function beforeEachBindings(fn) { jsmBeforeEach(() => { var bindings = fn(); if (!bindings) return; - testBindings = [... testBindings, ... bindings]; + testBindings = [...testBindings, ...bindings]; }); } @@ -142,7 +142,7 @@ function _it(jsmFn, name, fn) { return new AsyncTestCompleter(done); }); - var injector = createTestInjector([... testBindings, completerBinding]); + var injector = createTestInjector([...testBindings, completerBinding]); runner.run(injector); if (!(fn instanceof FunctionWithParamTokens)) { diff --git a/modules/angular2/src/util/decorators.ts b/modules/angular2/src/util/decorators.ts index 44cbc35b6a..330fec99e9 100644 --- a/modules/angular2/src/util/decorators.ts +++ b/modules/angular2/src/util/decorators.ts @@ -1,7 +1,7 @@ import {global} from 'angular2/src/facade/lang'; export function makeDecorator(annotationCls) { - return function(... args) { + return function(...args) { var Reflect = global.Reflect; if (!(Reflect && Reflect.getMetadata)) { throw 'reflect-metadata shim is required when using class decorators'; @@ -20,7 +20,7 @@ export function makeDecorator(annotationCls) { } export function makeParamDecorator(annotationCls): any { - return function(... args) { + return function(...args) { var Reflect = global.Reflect; if (!(Reflect && Reflect.getMetadata)) { throw 'reflect-metadata shim is required when using parameter decorators'; diff --git a/tools/broccoli/multi_copy.ts b/tools/broccoli/multi_copy.ts index 7d482c58f4..f53f56e674 100644 --- a/tools/broccoli/multi_copy.ts +++ b/tools/broccoli/multi_copy.ts @@ -9,11 +9,11 @@ var glob = require('glob'); export interface MultiCopyOptions { /** The path of the file to copy. */ - srcPath: string, + srcPath: string; /** A list of glob patterns of folders to copy to, matched against the input tree. */ - targetPatterns: string[], + targetPatterns: string[]; /** List of glob patterns to *not* copy to, matched against the matches from `targetPatterns`. */ - exclude?: string[], + exclude?: string[]; } /**