has
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "has", | ||
"description": "Object.prototype.hasOwnProperty.call shortcut", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"homepage": "https://github.com/tarruda/has", | ||
@@ -32,5 +32,2 @@ "author": { | ||
"main": "./src", | ||
"dependencies": { | ||
"function-bind": "^1.1.1" | ||
}, | ||
"devDependencies": { | ||
@@ -37,0 +34,0 @@ "@ljharb/eslint-config": "^12.2.1", |
'use strict'; | ||
var bind = require('function-bind'); | ||
var hasOwnProperty = {}.hasOwnProperty; | ||
var call = Function.prototype.call; | ||
module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); | ||
module.exports = call.bind ? call.bind(hasOwnProperty) : function (O, P) { | ||
return call.call(hasOwnProperty, O, P); | ||
}; |
@@ -9,3 +9,9 @@ 'use strict'; | ||
t.equal(has(Object.prototype, 'hasOwnProperty'), true, 'Object.prototype has own property "hasOwnProperty"'); | ||
t['throws'](function () { | ||
has(null, 'throws'); | ||
}, TypeError, 'calling has on null throws TypeError'); | ||
t['throws'](function () { | ||
has(void 0, 'throws'); | ||
}, TypeError, 'calling has on undefined throws TypeError'); | ||
t.end(); | ||
}); |
3025
0
20
- Removedfunction-bind@^1.1.1
- Removedfunction-bind@1.1.2(transitive)