Last change
on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
893 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var DESCRIPTORS = require('../internals/descriptors');
|
---|
| 2 | var UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all');
|
---|
| 3 | var defineProperty = require('../internals/object-define-property').f;
|
---|
| 4 | var getInternalState = require('../internals/internal-state').get;
|
---|
| 5 | var RegExpPrototype = RegExp.prototype;
|
---|
| 6 |
|
---|
| 7 | // `RegExp.prototype.dotAll` getter
|
---|
| 8 | // https://tc39.es/ecma262/#sec-get-regexp.prototype.dotall
|
---|
| 9 | if (DESCRIPTORS && UNSUPPORTED_DOT_ALL) {
|
---|
| 10 | defineProperty(RegExpPrototype, 'dotAll', {
|
---|
| 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).dotAll;
|
---|
| 18 | }
|
---|
| 19 | throw TypeError('Incompatible receiver, RegExp required');
|
---|
| 20 | }
|
---|
| 21 | });
|
---|
| 22 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.