| /** |
| * Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/> |
| * Build: `lodash modularize modern exports="node" -o ./modern/` |
| * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> |
| * Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE> |
| * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors |
| * Available under MIT license <http://lodash.com/license> |
| */ |
| var isNative = require('./isNative'), |
| noop = require('../utilities/noop'); |
| |
| /** Used as the property descriptor for `__bindData__` */ |
| var descriptor = { |
| 'configurable': false, |
| 'enumerable': false, |
| 'value': null, |
| 'writable': false |
| }; |
| |
| /** Used to set meta data on functions */ |
| var defineProperty = (function() { |
| // IE 8 only accepts DOM elements |
| try { |
| var o = {}, |
| func = isNative(func = Object.defineProperty) && func, |
| result = func(o, o, o) && func; |
| } catch(e) { } |
| return result; |
| }()); |
| |
| /** |
| * Sets `this` binding data on a given function. |
| * |
| * @private |
| * @param {Function} func The function to set data on. |
| * @param {Array} value The data array to set. |
| */ |
| var setBindData = !defineProperty ? noop : function(func, value) { |
| descriptor.value = value; |
| defineProperty(func, '__bindData__', descriptor); |
| }; |
| |
| module.exports = setBindData; |