Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

regexp-sticky-helpers.js 861B

12345678910111213141516171819202122232425262728293031
  1. 'use strict';
  2. var fails = require('../internals/fails');
  3. var globalThis = require('../internals/global-this');
  4. // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  5. var $RegExp = globalThis.RegExp;
  6. var UNSUPPORTED_Y = fails(function () {
  7. var re = $RegExp('a', 'y');
  8. re.lastIndex = 2;
  9. return re.exec('abcd') !== null;
  10. });
  11. // UC Browser bug
  12. // https://github.com/zloirock/core-js/issues/1008
  13. var MISSED_STICKY = UNSUPPORTED_Y || fails(function () {
  14. return !$RegExp('a', 'y').sticky;
  15. });
  16. var BROKEN_CARET = UNSUPPORTED_Y || fails(function () {
  17. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  18. var re = $RegExp('^r', 'gy');
  19. re.lastIndex = 2;
  20. return re.exec('str') !== null;
  21. });
  22. module.exports = {
  23. BROKEN_CARET: BROKEN_CARET,
  24. MISSED_STICKY: MISSED_STICKY,
  25. UNSUPPORTED_Y: UNSUPPORTED_Y
  26. };