source: imaps-frontend/node_modules/regexp.prototype.flags/implementation.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 710 bytes
Line 
1'use strict';
2
3var setFunctionName = require('set-function-name');
4var $TypeError = require('es-errors/type');
5
6var $Object = Object;
7
8module.exports = setFunctionName(function flags() {
9 if (this == null || this !== $Object(this)) {
10 throw new $TypeError('RegExp.prototype.flags getter called on non-object');
11 }
12 var result = '';
13 if (this.hasIndices) {
14 result += 'd';
15 }
16 if (this.global) {
17 result += 'g';
18 }
19 if (this.ignoreCase) {
20 result += 'i';
21 }
22 if (this.multiline) {
23 result += 'm';
24 }
25 if (this.dotAll) {
26 result += 's';
27 }
28 if (this.unicode) {
29 result += 'u';
30 }
31 if (this.unicodeSets) {
32 result += 'v';
33 }
34 if (this.sticky) {
35 result += 'y';
36 }
37 return result;
38}, 'get flags', true);
39
Note: See TracBrowser for help on using the repository browser.