source: imaps-frontend/node_modules/core-js/internals/regexp-sticky-helpers.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 861 bytes
Line 
1'use strict';
2var fails = require('../internals/fails');
3var globalThis = require('../internals/global-this');
4
5// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
6var $RegExp = globalThis.RegExp;
7
8var UNSUPPORTED_Y = fails(function () {
9 var re = $RegExp('a', 'y');
10 re.lastIndex = 2;
11 return re.exec('abcd') !== null;
12});
13
14// UC Browser bug
15// https://github.com/zloirock/core-js/issues/1008
16var MISSED_STICKY = UNSUPPORTED_Y || fails(function () {
17 return !$RegExp('a', 'y').sticky;
18});
19
20var BROKEN_CARET = UNSUPPORTED_Y || fails(function () {
21 // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
22 var re = $RegExp('^r', 'gy');
23 re.lastIndex = 2;
24 return re.exec('str') !== null;
25});
26
27module.exports = {
28 BROKEN_CARET: BROKEN_CARET,
29 MISSED_STICKY: MISSED_STICKY,
30 UNSUPPORTED_Y: UNSUPPORTED_Y
31};
Note: See TracBrowser for help on using the repository browser.