diff --git a/lib/ace/lib/regexp.js b/lib/ace/lib/regexp.js index 09e2bb7e..c3b9f5b5 100644 --- a/lib/ace/lib/regexp.js +++ b/lib/ace/lib/regexp.js @@ -42,7 +42,7 @@ define(function(require, exports, module) { RegExp.prototype.exec = function (str) { var match = real.exec.apply(this, arguments), name, r2; - if (match) { + if ( typeof(str) == 'string' && match) { // Fix browsers whose `exec` methods don't consistently return `undefined` for // nonparticipating capturing groups if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) { @@ -107,4 +107,4 @@ define(function(require, exports, module) { return -1; }; -}); \ No newline at end of file +});