chore(build): migrated di to TypeScript
This commit is contained in:
@@ -10,6 +10,8 @@ import {int, global, isPresent} from 'angular2/src/facade/lang';
|
||||
import {List} from 'angular2/src/facade/collection';
|
||||
import * as Rx from 'rx';
|
||||
|
||||
export var Promise = (<any>global).Promise;
|
||||
|
||||
export class PromiseWrapper {
|
||||
static resolve(obj): Promise<any> { return Promise.resolve(obj); }
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ class FunctionWrapper {
|
||||
class BaseException extends Error {
|
||||
final String message;
|
||||
|
||||
BaseException(this.message);
|
||||
BaseException([this.message]);
|
||||
|
||||
String toString() {
|
||||
return this.message;
|
||||
|
||||
@@ -9,6 +9,18 @@ export var __esModule = true;
|
||||
export var Type = Function;
|
||||
export type Type = typeof Function;
|
||||
|
||||
export class BaseException extends Error {
|
||||
message;
|
||||
stack;
|
||||
constructor(message?: string) {
|
||||
super(message);
|
||||
this.message = message;
|
||||
this.stack = (<any>new Error()).stack;
|
||||
}
|
||||
|
||||
toString(): string { return this.message; }
|
||||
}
|
||||
|
||||
export var Math = _global.Math;
|
||||
export var Date = _global.Date;
|
||||
|
||||
@@ -28,7 +40,9 @@ if (assertionsEnabled_) {
|
||||
}
|
||||
export {int};
|
||||
|
||||
export class CONST {}
|
||||
export function CONST() {
|
||||
return (target) => target;
|
||||
};
|
||||
export class ABSTRACT {}
|
||||
export class IMPLEMENTS {}
|
||||
|
||||
@@ -111,10 +125,10 @@ export class StringJoiner {
|
||||
toString(): string { return this.parts.join(""); }
|
||||
}
|
||||
|
||||
export class NumberParseError implements Error {
|
||||
export class NumberParseError extends BaseException {
|
||||
name: string;
|
||||
|
||||
constructor(public message: string) {}
|
||||
constructor(public message: string) { super(); }
|
||||
|
||||
toString() { return this.message; }
|
||||
}
|
||||
@@ -191,9 +205,6 @@ export class FunctionWrapper {
|
||||
static apply(fn: Function, posArgs) { return fn.apply(null, posArgs); }
|
||||
}
|
||||
|
||||
// No subclass so that we preserve error stack.
|
||||
export var BaseException = Error;
|
||||
|
||||
// JS has NaN !== NaN
|
||||
export function looseIdentical(a, b): boolean {
|
||||
return a === b || typeof a === "number" && typeof b === "number" && isNaN(a) && isNaN(b);
|
||||
|
||||
Reference in New Issue
Block a user