$.flags.js 376 B

12345678910111213
  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. , 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. };