ES6 spec-compliant RegExp.prototype.flags shim.