| 2974 | |
| 2975 | |
| 2976 | function addGetHookIf( conditionFn, hookFn ) { |
| 2977 | // Define the hook, we'll check on the first run if it's really needed. |
| 2978 | return { |
| 2979 | get: function() { |
| 2980 | if ( conditionFn() ) { |
| 2981 | // Hook not needed (or it's not possible to use it due to missing dependency), |
| 2982 | // remove it. |
| 2983 | // Since there are no other hooks for marginRight, remove the whole object. |
| 2984 | delete this.get; |
| 2985 | return; |
| 2986 | } |
| 2987 | |
| 2988 | // Hook needed; redefine it so that the support test is not executed again. |
| 2989 | |
| 2990 | return (this.get = hookFn).apply( this, arguments ); |
| 2991 | } |
| 2992 | }; |
| 2993 | } |
| 2994 | |
| 2995 | |
| 2996 | (function() { |