( conditionFn, hookFn )
| 5568 | |
| 5569 | |
| 5570 | function addGetHookIf( conditionFn, hookFn ) { |
| 5571 | // Define the hook, we'll check on the first run if it's really needed. |
| 5572 | return { |
| 5573 | get: function() { |
| 5574 | if ( conditionFn() ) { |
| 5575 | // Hook not needed (or it's not possible to use it due to missing dependency), |
| 5576 | // remove it. |
| 5577 | // Since there are no other hooks for marginRight, remove the whole object. |
| 5578 | delete this.get; |
| 5579 | return; |
| 5580 | } |
| 5581 | |
| 5582 | // Hook needed; redefine it so that the support test is not executed again. |
| 5583 | |
| 5584 | return (this.get = hookFn).apply( this, arguments ); |
| 5585 | } |
| 5586 | }; |
| 5587 | } |
| 5588 | |
| 5589 | |
| 5590 | (function() { |
no outgoing calls
no test coverage detected
searching dependent graphs…