Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object.prototype.toString behaves incorrectly when applied to boxed primitives #103

Open
cpcallen opened this issue Jun 9, 2017 · 0 comments

Comments

@cpcallen
Copy link
Collaborator

cpcallen commented Jun 9, 2017

The following should evaluate to [object String] but in fact evaluates to "Hello":

Object.prototype.toString.apply(new String("Hello"))

Indeed, in general this method should always return a string of the form "[object [[Class]] ]", where [[Class]] is as defined in §8.6.2 of the ES5.1 spec.

This is a generalisation #98—though that bug now also covers other unusual behaviours of arguments.

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

No branches or pull requests

1 participant