Skip to content

Commit 024d442

Browse files
committed
[Fix] properly check for a non-object receiver
Previously this threw for null/undefined, but on Object(nullish) or nullish.property.
1 parent c692c88 commit 024d442

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

implementation.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var $TypeError = require('es-errors/type');
66
var $Object = Object;
77

88
module.exports = setFunctionName(function flags() {
9-
if (this != null && this !== $Object(this)) {
9+
if (this == null || this !== $Object(this)) {
1010
throw new $TypeError('RegExp.prototype.flags getter called on non-object');
1111
}
1212
var result = '';

0 commit comments

Comments
 (0)