_flags.js 370 B

1234567891011121314
  1. 'use strict';
  2. // 21.2.5.3 get RegExp.prototype.flags
  3. var anObject = require('./_an-object');
  4. module.exports = function () {
  5. var that = anObject(this);
  6. var result = '';
  7. if (that.global) result += 'g';
  8. if (that.ignoreCase) result += 'i';
  9. if (that.multiline) result += 'm';
  10. if (that.unicode) result += 'u';
  11. if (that.sticky) result += 'y';
  12. return result;
  13. };