feat(perf): port table scrolling benchmark to Angular 2

This commit is contained in:
Yegor Jbanov
2015-02-05 18:33:57 -08:00
parent 93c18f5396
commit fcbdf02767
21 changed files with 1119 additions and 11 deletions
@@ -360,7 +360,7 @@ function _operationToFunction(operation:string):Function {
}
function s(v) {
return isPresent(v) ? '' + v : '';
return isPresent(v) ? `${v}` : '';
}
function _interpolationFn(strings:List) {
+2 -1
View File
@@ -411,7 +411,8 @@ export class ProtoView {
// view might get dehydrated, in between the event queuing up and
// firing.
if (view.hydrated()) {
MapWrapper.set(locals, '\$event', event);
// HACK
MapWrapper.set(locals, `$event`, event);
var context = new ContextWithVariableBindings(view.context, locals);
expr.eval(context);
}
+4 -1
View File
@@ -71,7 +71,7 @@ class StringMapWrapper {
}
class ListWrapper {
static List clone(List l) => new List.from(l);
static List clone(Iterable l) => new List.from(l);
static List create() => new List();
static List createFixedSize(int size) => new List(size);
static get(List m, int k) => m[k];
@@ -137,6 +137,9 @@ class ListWrapper {
}
return true;
}
static List slice(List l, int from, int to) {
return l.sublist(from, to);
}
}
bool isListLikeIterable(obj) => obj is Iterable;
@@ -176,6 +176,9 @@ export class ListWrapper {
}
return true;
}
static slice(l:List, from:int, to:int):List {
return l.slice(from, to);
}
}
export function isListLikeIterable(obj):boolean {
+4
View File
@@ -6,4 +6,8 @@ class Math {
static num pow(num x, num exponent) {
return math.pow(x, exponent);
}
static num min(num a, num b) => math.min(a, b);
static num floor(num a) => a.floor();
}