Skip to content

Commit b19da31

Browse files
committedJan 4, 2021
[Refactor] use call-bind/callBound instead of function-bind directly
1 parent 04da90b commit b19da31

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed
 

‎lib/results.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ var inherits = require('inherits');
66
var through = require('through');
77
var resumer = require('resumer');
88
var inspect = require('object-inspect');
9-
var bind = require('function-bind');
9+
var callBound = require('call-bind/callBound');
1010
var has = require('has');
11-
var regexpTest = bind.call(Function.call, RegExp.prototype.test);
11+
var regexpTest = callBound('RegExp.prototype.test');
1212
var yamlIndicators = /:|-|\?/;
1313
var nextTick = typeof setImmediate !== 'undefined'
1414
? setImmediate

‎lib/test.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ var EventEmitter = require('events').EventEmitter;
88
var has = require('has');
99
var isRegExp = require('is-regex');
1010
var trim = require('string.prototype.trim');
11-
var bind = require('function-bind');
11+
var callBound = require('call-bind/callBound');
1212
var forEach = require('for-each');
1313
var inspect = require('object-inspect');
1414
var is = require('object-is');
15-
var isEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable);
16-
var toLowerCase = bind.call(Function.call, String.prototype.toLowerCase);
17-
var isProto = bind.call(Function.call, Object.prototype.isPrototypeOf);
18-
var $test = bind.call(Function.call, RegExp.prototype.test);
19-
var objectToString = bind.call(Function.call, Object.prototype.toString);
15+
var isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
16+
var toLowerCase = callBound('String.prototype.toLowerCase');
17+
var isProto = callBound('Object.prototype.isPrototypeOf');
18+
var $test = callBound('RegExp.prototype.test');
19+
var objectToString = callBound('Object.prototype.toString');
2020

2121
module.exports = Test;
2222

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
"test": "test"
2323
},
2424
"dependencies": {
25+
"call-bind": "^1.0.0",
2526
"deep-equal": "^2.0.5",
2627
"defined": "^1.0.0",
2728
"dotignore": "^0.1.2",
2829
"for-each": "^0.3.3",
29-
"function-bind": "^1.1.1",
3030
"glob": "^7.1.6",
3131
"has": "^1.0.3",
3232
"inherits": "^2.0.4",

0 commit comments

Comments
 (0)
Please sign in to comment.