Skip to content

Commit

Permalink
[Robustness] test observably looks up exec on the object
Browse files Browse the repository at this point in the history
take 2
  • Loading branch information
ljharb committed Apr 8, 2022
1 parent b2d547a commit 330f8d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/results.js
Expand Up @@ -8,7 +8,7 @@ var resumer = require('resumer');
var inspect = require('object-inspect');
var callBound = require('call-bind/callBound');
var has = require('has');
var regexpTest = callBound('RegExp.prototype.test');
var $exec = callBound('RegExp.prototype.exec');
var $split = callBound('String.prototype.split');
var $replace = callBound('String.prototype.replace');
var $shift = callBound('Array.prototype.shift');
Expand Down Expand Up @@ -226,5 +226,5 @@ function getNextTest(results) {
}

function invalidYaml(str) {
return regexpTest(yamlIndicators, str);
return $exec(yamlIndicators, str) !== null;
}

0 comments on commit 330f8d5

Please sign in to comment.