Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit c54228f

Browse files
committed
perf($parse): don't use reflective calls in generated functions
Chrome and FF are smart enough to notice that the key is is a string literal, so this change doesn't make a difference there. Safari gets a boost. I haven't tested IE, but it can't cause harm there. :) http://jsperf.com/fn-dereferencing
1 parent 99a2f0a commit c54228f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ng/parse.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ function getterFn(path, options, fullExp) {
909909
// we simply dereference 's' on any .dot notation
910910
? 's'
911911
// but if we are first then we check locals first, and if so read it first
912-
: '((k&&k.hasOwnProperty("' + key + '"))?k:s)') + '["' + key + '"]' + ';\n';
912+
: '((k&&k.hasOwnProperty("' + key + '"))?k:s)') + '.' + key + ';\n';
913913
});
914914
code += 'return s;';
915915

0 commit comments

Comments
 (0)