@@ -985,26 +985,6 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {
985
985
} ;
986
986
}
987
987
988
- function simpleGetterFn1 ( key0 , fullExp ) {
989
- ensureSafeMemberName ( key0 , fullExp ) ;
990
-
991
- return function simpleGetterFn1 ( scope , locals ) {
992
- if ( scope == null ) return undefined ;
993
- return ( ( locals && locals . hasOwnProperty ( key0 ) ) ? locals : scope ) [ key0 ] ;
994
- } ;
995
- }
996
-
997
- function simpleGetterFn2 ( key0 , key1 , fullExp ) {
998
- ensureSafeMemberName ( key0 , fullExp ) ;
999
- ensureSafeMemberName ( key1 , fullExp ) ;
1000
-
1001
- return function simpleGetterFn2 ( scope , locals ) {
1002
- if ( scope == null ) return undefined ;
1003
- scope = ( ( locals && locals . hasOwnProperty ( key0 ) ) ? locals : scope ) [ key0 ] ;
1004
- return scope == null ? undefined : scope [ key1 ] ;
1005
- } ;
1006
- }
1007
-
1008
988
function getterFn ( path , options , fullExp ) {
1009
989
// Check whether the cache has this getter already.
1010
990
// We can use hasOwnProperty directly on the cache because we ensure,
@@ -1017,13 +997,8 @@ function getterFn(path, options, fullExp) {
1017
997
pathKeysLength = pathKeys . length ,
1018
998
fn ;
1019
999
1020
- // When we have only 1 or 2 tokens, use optimized special case closures.
1021
1000
// http://jsperf.com/angularjs-parse-getter/6
1022
- if ( ! options . unwrapPromises && pathKeysLength === 1 ) {
1023
- fn = simpleGetterFn1 ( pathKeys [ 0 ] , fullExp ) ;
1024
- } else if ( ! options . unwrapPromises && pathKeysLength === 2 ) {
1025
- fn = simpleGetterFn2 ( pathKeys [ 0 ] , pathKeys [ 1 ] , fullExp ) ;
1026
- } else if ( options . csp ) {
1001
+ if ( options . csp ) {
1027
1002
if ( pathKeysLength < 6 ) {
1028
1003
fn = cspSafeGetterFn ( pathKeys [ 0 ] , pathKeys [ 1 ] , pathKeys [ 2 ] , pathKeys [ 3 ] , pathKeys [ 4 ] , fullExp ,
1029
1004
options ) ;
0 commit comments