massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / internals / regexp-sticky-helpers.js
1 var fails = require('../internals/fails');
2 var global = require('../internals/global');
3
4 // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
5 var $RegExp = global.RegExp;
6
7 var UNSUPPORTED_Y = fails(function () {
8   var re = $RegExp('a', 'y');
9   re.lastIndex = 2;
10   return re.exec('abcd') != null;
11 });
12
13 // UC Browser bug
14 // https://github.com/zloirock/core-js/issues/1008
15 var MISSED_STICKY = UNSUPPORTED_Y || fails(function () {
16   return !$RegExp('a', 'y').sticky;
17 });
18
19 var BROKEN_CARET = UNSUPPORTED_Y || fails(function () {
20   // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
21   var re = $RegExp('^r', 'gy');
22   re.lastIndex = 2;
23   return re.exec('str') != null;
24 });
25
26 module.exports = {
27   BROKEN_CARET: BROKEN_CARET,
28   MISSED_STICKY: MISSED_STICKY,
29   UNSUPPORTED_Y: UNSUPPORTED_Y
30 };