Skip to content

Commit

Permalink
[Tests] RegExp#toString: Chrome Canary 51 produces /undefined/
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Mar 1, 2016
1 parent b9eda4e commit 6bca7e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/regexp.js
Expand Up @@ -16,8 +16,10 @@ var ifShimIt = (typeof process !== 'undefined' && process.env.NO_ES6_SHIM) ? it.
var hasSymbols = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' && typeof Symbol() === 'symbol';
var ifSymbolsDescribe = hasSymbols ? describe : describe.skip;
var defaultRegex = (function () {
// Chrome Canary 51 has an undefined RegExp#toSource, and
// RegExp#toString produces `/undefined/`
try {
return String(RegExp.prototype);
return RegExp.prototype.source ? String(RegExp.prototype) : '/(?:)/';
} catch (e) {
return '/(?:)/';
}
Expand Down

0 comments on commit 6bca7e1

Please sign in to comment.