@@ -875,26 +875,6 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp) {
875
875
} ;
876
876
}
877
877
878
- function simpleGetterFn1 ( key0 , fullExp ) {
879
- ensureSafeMemberName ( key0 , fullExp ) ;
880
-
881
- return function simpleGetterFn1 ( scope , locals ) {
882
- if ( scope == null ) return undefined ;
883
- return ( ( locals && locals . hasOwnProperty ( key0 ) ) ? locals : scope ) [ key0 ] ;
884
- } ;
885
- }
886
-
887
- function simpleGetterFn2 ( key0 , key1 , fullExp ) {
888
- ensureSafeMemberName ( key0 , fullExp ) ;
889
- ensureSafeMemberName ( key1 , fullExp ) ;
890
-
891
- return function simpleGetterFn2 ( scope , locals ) {
892
- if ( scope == null ) return undefined ;
893
- scope = ( ( locals && locals . hasOwnProperty ( key0 ) ) ? locals : scope ) [ key0 ] ;
894
- return scope == null ? undefined : scope [ key1 ] ;
895
- } ;
896
- }
897
-
898
878
function getterFn ( path , options , fullExp ) {
899
879
// Check whether the cache has this getter already.
900
880
// We can use hasOwnProperty directly on the cache because we ensure,
@@ -907,13 +887,8 @@ function getterFn(path, options, fullExp) {
907
887
pathKeysLength = pathKeys . length ,
908
888
fn ;
909
889
910
- // When we have only 1 or 2 tokens, use optimized special case closures.
911
890
// http://jsperf.com/angularjs-parse-getter/6
912
- if ( pathKeysLength === 1 ) {
913
- fn = simpleGetterFn1 ( pathKeys [ 0 ] , fullExp ) ;
914
- } else if ( pathKeysLength === 2 ) {
915
- fn = simpleGetterFn2 ( pathKeys [ 0 ] , pathKeys [ 1 ] , fullExp ) ;
916
- } else if ( options . csp ) {
891
+ if ( options . csp ) {
917
892
if ( pathKeysLength < 6 ) {
918
893
fn = cspSafeGetterFn ( pathKeys [ 0 ] , pathKeys [ 1 ] , pathKeys [ 2 ] , pathKeys [ 3 ] , pathKeys [ 4 ] , fullExp ) ;
919
894
} else {
0 commit comments