feat(zone): add support for long stack traces
This commit is contained in:
@ -12,11 +12,11 @@ class PromiseWrapper {
|
||||
return new Future.error(obj);
|
||||
}
|
||||
|
||||
static Future<List> all(List<Future> promises){
|
||||
static Future<List> all(List<Future> promises) {
|
||||
return Future.wait(promises);
|
||||
}
|
||||
|
||||
static Future then(Future promise, Function success, Function onError){
|
||||
static Future then(Future promise, Function success, Function onError) {
|
||||
if (success == null) return promise.catchError(onError);
|
||||
return promise.then(success, onError: onError);
|
||||
}
|
||||
@ -24,13 +24,24 @@ class PromiseWrapper {
|
||||
static completer(){
|
||||
return new _Completer(new Completer());
|
||||
}
|
||||
|
||||
static setTimeout(fn, millis) {
|
||||
new Timer(new Duration(milliseconds: millis), fn);
|
||||
}
|
||||
}
|
||||
|
||||
class _Completer {
|
||||
Completer c;
|
||||
|
||||
_Completer(this.c);
|
||||
|
||||
get promise => c.future;
|
||||
get complete => c.complete;
|
||||
get reject => c.completeError;
|
||||
|
||||
complete(v) {
|
||||
c.complete(v);
|
||||
}
|
||||
|
||||
reject(v) {
|
||||
c.completeError(v);
|
||||
}
|
||||
}
|
||||
|
@ -33,4 +33,8 @@ export class PromiseWrapper {
|
||||
reject: reject
|
||||
};
|
||||
}
|
||||
|
||||
static setTimeout(fn, millis) {
|
||||
window.setTimeout(fn, millis);
|
||||
}
|
||||
}
|
@ -59,6 +59,24 @@ export class StringMapWrapper {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static merge(m1, m2) {
|
||||
var m = {};
|
||||
|
||||
for (var attr in m1) {
|
||||
if (m1.hasOwnProperty(attr)){
|
||||
m[attr] = m1[attr];
|
||||
}
|
||||
}
|
||||
|
||||
for (var attr in m2) {
|
||||
if (m2.hasOwnProperty(attr)){
|
||||
m[attr] = m2[attr];
|
||||
}
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
}
|
||||
|
||||
export class ListWrapper {
|
||||
|
@ -214,4 +214,8 @@ export function assertionsEnabled() {
|
||||
} catch (e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export function print(obj) {
|
||||
console.log(obj);
|
||||
}
|
Reference in New Issue
Block a user