main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
1006 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var DESCRIPTORS = require('../internals/descriptors');
|
---|
3 | var UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all');
|
---|
4 | var classof = require('../internals/classof-raw');
|
---|
5 | var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
|
---|
6 | var getInternalState = require('../internals/internal-state').get;
|
---|
7 |
|
---|
8 | var RegExpPrototype = RegExp.prototype;
|
---|
9 | var $TypeError = TypeError;
|
---|
10 |
|
---|
11 | // `RegExp.prototype.dotAll` getter
|
---|
12 | // https://tc39.es/ecma262/#sec-get-regexp.prototype.dotall
|
---|
13 | if (DESCRIPTORS && UNSUPPORTED_DOT_ALL) {
|
---|
14 | defineBuiltInAccessor(RegExpPrototype, 'dotAll', {
|
---|
15 | configurable: true,
|
---|
16 | get: function dotAll() {
|
---|
17 | if (this === RegExpPrototype) return;
|
---|
18 | // We can't use InternalStateModule.getterFor because
|
---|
19 | // we don't add metadata for regexps created by a literal.
|
---|
20 | if (classof(this) === 'RegExp') {
|
---|
21 | return !!getInternalState(this).dotAll;
|
---|
22 | }
|
---|
23 | throw new $TypeError('Incompatible receiver, RegExp required');
|
---|
24 | }
|
---|
25 | });
|
---|
26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.