Skip to content

fix: Prevent spoofing with [Symbol.toStringTag]#20

Open
ExE-Boss wants to merge 1 commit intomanuelstofer:masterfrom
EB-Forks:fix/symbol-tostringtag
Open

fix: Prevent spoofing with [Symbol.toStringTag]#20
ExE-Boss wants to merge 1 commit intomanuelstofer:masterfrom
EB-Forks:fix/symbol-tostringtag

Conversation

@ExE-Boss
Copy link

Currently, forEach uses toString.call(fn) !== '[object Function]' to detect whether the callback is a valid function, but this doesn’t work in environments that have Symbol.toStringTag.

This fixes that to account for objects with a spoofed [Symbol.toStringTag] property and functions with a custom [Symbol.toStringTag] property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant