diff options
| author | Karl Seamon | 2013-12-05 18:08:52 -0500 |
|---|---|---|
| committer | Igor Minar | 2013-12-18 15:44:15 -0800 |
| commit | 864b2596b246470cca9d4e223eaed720f4462319 (patch) | |
| tree | 1b86f335f5afc3b21217fa3d8ab327718112db2e /test | |
| parent | f3a796e522afdbd3b640d14426edb2fbfab463c5 (diff) | |
| download | angular.js-864b2596b246470cca9d4e223eaed720f4462319.tar.bz2 | |
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
Diffstat (limited to 'test')
| -rw-r--r-- | test/ng/parseSpec.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ng/parseSpec.js b/test/ng/parseSpec.js index 2147c4b0..5e985f1f 100644 --- a/test/ng/parseSpec.js +++ b/test/ng/parseSpec.js @@ -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); })); }); |
