ohctechv3/.svn/pristine/62/62709ff98ac44de6e57bc78c5370b0be7cd26a32.svn-base
2024-10-28 15:03:36 +05:30

40 lines
710 B
Plaintext

'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);