mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
perf($parse) use a faster path when the number of path parts is low
Use a faster path when the number of path tokens is low (ie the common case). This results in a better than 19x improvement in the time spent in $parse and produces output that is about the same speed in chrome and substantially faster in firefox. http://jsperf.com/angularjs-parse-getter/6 Closes #5359
This commit is contained in:
@@ -906,6 +906,7 @@ describe('parser', function() {
|
||||
expect($parse('a.b')({a: {b: 0}}, {a: {b:1}})).toEqual(1);
|
||||
expect($parse('a.b')({a: null}, {a: {b:1}})).toEqual(1);
|
||||
expect($parse('a.b')({a: {b: 0}}, {a: null})).toEqual(undefined);
|
||||
expect($parse('a.b.c')({a: null}, {a: {b: {c: 1}}})).toEqual(1);
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user