Last change
on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
515 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var $Object = Object;
|
---|
4 | var $TypeError = TypeError;
|
---|
5 |
|
---|
6 | module.exports = function flags() {
|
---|
7 | if (this != null && this !== $Object(this)) {
|
---|
8 | throw new $TypeError('RegExp.prototype.flags getter called on non-object');
|
---|
9 | }
|
---|
10 | var result = '';
|
---|
11 | if (this.global) {
|
---|
12 | result += 'g';
|
---|
13 | }
|
---|
14 | if (this.ignoreCase) {
|
---|
15 | result += 'i';
|
---|
16 | }
|
---|
17 | if (this.multiline) {
|
---|
18 | result += 'm';
|
---|
19 | }
|
---|
20 | if (this.dotAll) {
|
---|
21 | result += 's';
|
---|
22 | }
|
---|
23 | if (this.unicode) {
|
---|
24 | result += 'u';
|
---|
25 | }
|
---|
26 | if (this.sticky) {
|
---|
27 | result += 'y';
|
---|
28 | }
|
---|
29 | return result;
|
---|
30 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.