source: trip-planner-front/node_modules/core-js/modules/es.regexp.sticky.js@ b738035

Last change on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 890 bytes
Line 
1var DESCRIPTORS = require('../internals/descriptors');
2var UNSUPPORTED_Y = require('../internals/regexp-sticky-helpers').UNSUPPORTED_Y;
3var defineProperty = require('../internals/object-define-property').f;
4var getInternalState = require('../internals/internal-state').get;
5var RegExpPrototype = RegExp.prototype;
6
7// `RegExp.prototype.sticky` getter
8// https://tc39.es/ecma262/#sec-get-regexp.prototype.sticky
9if (DESCRIPTORS && UNSUPPORTED_Y) {
10 defineProperty(RegExpPrototype, 'sticky', {
11 configurable: true,
12 get: function () {
13 if (this === RegExpPrototype) return undefined;
14 // We can't use InternalStateModule.getterFor because
15 // we don't add metadata for regexps created by a literal.
16 if (this instanceof RegExp) {
17 return !!getInternalState(this).sticky;
18 }
19 throw TypeError('Incompatible receiver, RegExp required');
20 }
21 });
22}
Note: See TracBrowser for help on using the repository browser.