mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-01-12 22:45:52 +08:00
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
This commit is contained in:
@@ -909,7 +909,7 @@ function getterFn(path, options, fullExp) {
|
||||
// we simply dereference 's' on any .dot notation
|
||||
? 's'
|
||||
// but if we are first then we check locals first, and if so read it first
|
||||
: '((k&&k.hasOwnProperty("' + key + '"))?k:s)') + '["' + key + '"]' + ';\n';
|
||||
: '((k&&k.hasOwnProperty("' + key + '"))?k:s)') + '.' + key + ';\n';
|
||||
});
|
||||
code += 'return s;';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user