fei.wang
2025-08-13 ae7b22322555448d95fd56f505bafa325c167a26
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
'use strict';
 
var setFunctionName = require('set-function-name');
var $TypeError = require('es-errors/type');
 
var $Object = Object;
 
module.exports = setFunctionName(function flags() {
    if (this == null || this !== $Object(this)) {
        throw new $TypeError('RegExp.prototype.flags getter called on non-object');
    }
    var result = '';
    if (this.hasIndices) {
        result += 'd';
    }
    if (this.global) {
        result += 'g';
    }
    if (this.ignoreCase) {
        result += 'i';
    }
    if (this.multiline) {
        result += 'm';
    }
    if (this.dotAll) {
        result += 's';
    }
    if (this.unicode) {
        result += 'u';
    }
    if (this.unicodeSets) {
        result += 'v';
    }
    if (this.sticky) {
        result += 'y';
    }
    return result;
}, 'get flags', true);