Skip to content

Commit

Permalink
Use function-bind to ensure we're robust against modification of `F…
Browse files Browse the repository at this point in the history
…unction#call`
  • Loading branch information
ljharb committed Aug 15, 2015
1 parent e82c1e8 commit 88d567c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/results.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ var inherits = require('inherits');
var through = require('through');
var resumer = require('resumer');
var inspect = require('object-inspect');
var bind = require('function-bind');
var has = require('has');
var regexpTest = RegExp.prototype.test;
var regexpTest = bind.call(Function.call, RegExp.prototype.test);
var yamlIndicators = /\:|\-|\?/;
var nextTick = typeof setImmediate !== 'undefined'
? setImmediate
Expand Down Expand Up @@ -187,5 +188,5 @@ function getNextTest (results) {
}

function invalidYaml (str) {
return regexpTest.call(yamlIndicators, str);
return regexpTest(yamlIndicators, str);
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"dependencies": {
"deep-equal": "~1.0.0",
"defined": "~0.0.0",
"function-bind": "~1.0.2",
"glob": "~5.0.3",
"has": "~1.0.1",
"inherits": "~2.0.1",
Expand Down

0 comments on commit 88d567c

Please sign in to comment.