fix: fix clang errors

This commit is contained in:
Jeff Cross 2015-05-28 11:08:26 -07:00
parent 9d90128463
commit 01fb8e6635
5 changed files with 23 additions and 24 deletions

View File

@ -2,7 +2,7 @@ var _global: BrowserNodeGlobal = <any>(typeof window === 'undefined' ? global :
export {_global as global}; export {_global as global};
export var Type = Function; export var Type = Function;
export type Type = new (... args: any[]) => any; export type Type = new (...args: any[]) => any;
export class BaseException extends Error { export class BaseException extends Error {
message; message;
@ -116,7 +116,7 @@ export class StringWrapper {
} }
static replaceAllMapped(s: string, from: RegExp, cb: Function): string { 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 // Remove offset & string from the result array
matches.splice(-2, 2); matches.splice(-2, 2);
// The callback receives match, p1, ..., pn // The callback receives match, p1, ..., pn

View File

@ -78,8 +78,8 @@ export class TestBed {
* @return {Promise<ViewProxy>} * @return {Promise<ViewProxy>}
*/ */
createView(component: Type, createView(component: Type,
{context = null, {context = null, html = null}: {context?: any,
html = null}: {context?: any, html?: string} = {}): Promise<ViewProxy> { html?: string} = {}): Promise<ViewProxy> {
if (isBlank(component) && isBlank(context)) { if (isBlank(component) && isBlank(context)) {
throw new BaseException('You must specified at least a component or a context'); throw new BaseException('You must specified at least a component or a context');
} }

View File

@ -72,25 +72,25 @@ class BeforeEachRunner {
// Reset the test bindings before each test // Reset the test bindings before each test
jsmBeforeEach(() => { testBindings = []; }); jsmBeforeEach(() => { testBindings = []; });
function _describe(jsmFn, ... args) { function _describe(jsmFn, ...args) {
var parentRunner = runnerStack.length === 0 ? null : runnerStack[runnerStack.length - 1]; var parentRunner = runnerStack.length === 0 ? null : runnerStack[runnerStack.length - 1];
var runner = new BeforeEachRunner(parentRunner); var runner = new BeforeEachRunner(parentRunner);
runnerStack.push(runner); runnerStack.push(runner);
var suite = jsmFn(... args); var suite = jsmFn(...args);
runnerStack.pop(); runnerStack.pop();
return suite; return suite;
} }
export function describe(... args) { export function describe(...args) {
return _describe(jsmDescribe, ... args); return _describe(jsmDescribe, ...args);
} }
export function ddescribe(... args) { export function ddescribe(...args) {
return _describe(jsmDDescribe, ... args); return _describe(jsmDDescribe, ...args);
} }
export function xdescribe(... args) { export function xdescribe(...args) {
return _describe(jsmXDescribe, ... args); return _describe(jsmXDescribe, ...args);
} }
export function beforeEach(fn) { export function beforeEach(fn) {
@ -123,7 +123,7 @@ export function beforeEachBindings(fn) {
jsmBeforeEach(() => { jsmBeforeEach(() => {
var bindings = fn(); var bindings = fn();
if (!bindings) return; if (!bindings) return;
testBindings = [... testBindings, ... bindings]; testBindings = [...testBindings, ...bindings];
}); });
} }
@ -142,7 +142,7 @@ function _it(jsmFn, name, fn) {
return new AsyncTestCompleter(done); return new AsyncTestCompleter(done);
}); });
var injector = createTestInjector([... testBindings, completerBinding]); var injector = createTestInjector([...testBindings, completerBinding]);
runner.run(injector); runner.run(injector);
if (!(fn instanceof FunctionWithParamTokens)) { if (!(fn instanceof FunctionWithParamTokens)) {

View File

@ -1,7 +1,7 @@
import {global} from 'angular2/src/facade/lang'; import {global} from 'angular2/src/facade/lang';
export function makeDecorator(annotationCls) { export function makeDecorator(annotationCls) {
return function(... args) { return function(...args) {
var Reflect = global.Reflect; var Reflect = global.Reflect;
if (!(Reflect && Reflect.getMetadata)) { if (!(Reflect && Reflect.getMetadata)) {
throw 'reflect-metadata shim is required when using class decorators'; throw 'reflect-metadata shim is required when using class decorators';
@ -20,7 +20,7 @@ export function makeDecorator(annotationCls) {
} }
export function makeParamDecorator(annotationCls): any { export function makeParamDecorator(annotationCls): any {
return function(... args) { return function(...args) {
var Reflect = global.Reflect; var Reflect = global.Reflect;
if (!(Reflect && Reflect.getMetadata)) { if (!(Reflect && Reflect.getMetadata)) {
throw 'reflect-metadata shim is required when using parameter decorators'; throw 'reflect-metadata shim is required when using parameter decorators';

View File

@ -8,14 +8,13 @@ export function iterableChangesAsString({collection = CONST_EXPR([]), previous =
"removals: " + removals.join(', ') + "\n"; "removals: " + removals.join(', ') + "\n";
} }
export function kvChangesAsString({map, previous, additions, changes, removals}: export function kvChangesAsString({map, previous, additions, changes, removals}: {
{ map?: List<any>,
map?:List<any>, previous?: List<any>,
previous?:List<any>, additions?: List<any>,
additions?: List<any>, changes?: List<any>,
changes?: List<any>, removals?: List<any>
removals?: List<any> }): string {
}):string {
if (isBlank(map)) map = []; if (isBlank(map)) map = [];
if (isBlank(previous)) previous = []; if (isBlank(previous)) previous = [];
if (isBlank(additions)) additions = []; if (isBlank(additions)) additions = [];