You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RageKnify
changed the title
String used as a function call messes up with the global object
Invoking constructors changes global this instead of newTarget
Dec 29, 2020
Describe the bug
String
used as a function call messes up with the global object.To Reproduce
This JavaScript code reproduces the issue:
Running this code,
2
is printed asthis.length
and"10"
is printed asString.prototype.toString.call(this)
.Expected behavior
Running this code,
this.length
should stayundefined
andString.prototype.toString.call(this)
should throw aTypeError
.Build environment (please complete the following information):
Additional context
None
The text was updated successfully, but these errors were encountered: