Skip to content

Commit

Permalink
thwart ROLLUP tree-shaking; see rollup/rollup#2181
Browse files Browse the repository at this point in the history
  • Loading branch information
GerHobbelt committed May 7, 2018
1 parent 115b686 commit cbb69e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/xregexp.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ function hasNativeFlag(flag) {
try {
// Can't use regex literals for testing even in a `try` because regex literals with
// unsupported flags cause a compilation error in IE
new RegExp('', flag);
var x = new RegExp('', flag);
isSupported = !!x || true; // thwart ROLLUP tree-shaking; see https://github.com/rollup/rollup/issues/2181
} catch (exception) {
isSupported = false;
}
Expand Down Expand Up @@ -739,7 +740,7 @@ XRegExp.prototype = new RegExp();
* @memberOf XRegExp
* @type String
*/
XRegExp.version = '3.2.0-22';
XRegExp.version = '4.0.0-22';

// ==--------------------------==
// Public methods
Expand Down

0 comments on commit cbb69e6

Please sign in to comment.