Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Object.prototype.toString.call does not behave as expected #11722

Closed
courtnek opened this issue Oct 30, 2013 · 10 comments
Closed

Object.prototype.toString.call does not behave as expected #11722

courtnek opened this issue Oct 30, 2013 · 10 comments

Comments

@courtnek
Copy link

Filing an issue to track the following behavior (tested with Phantom 1.6.0):

http://stackoverflow.com/questions/14218670/why-are-null-and-undefined-of-the-type-domwindow

phantomjs> Object.prototype.toString.call(undefined);
"[object DOMWindow]"

@sodabrew
Copy link
Contributor

Test again with PhantomJS 1.9.2, since that is the current release.

@jeffrifwald
Copy link

I can confirm Object.prototype.toString.call on both null and undefined returns [object DOMWindow] on Phantom 1.9.2 on my system.

@courtnek
Copy link
Author

Actually I tried 1.9.2 on linux and got the following:

phantomjs> Object.prototype.toString.call(null)
{}
phantomjs> Object.prototype.toString.call(undefined)
{}
phantomjs> Object.prototype.toString.call("string")
{}

@JamesMGreene
Copy link
Collaborator

@courtnek: Don't trust the REPL.

@courtnek
Copy link
Author

Confirmed. Still present in 1.9.2

@kibin
Copy link

kibin commented Jun 16, 2015

Any updates on this? I have this issue on 1.9.8

@LeMoussel
Copy link

On Windows 7, with PhantomJS 2.0.0 I haven't this issue

phantomjs> Object.prototype.toString.call(undefined);
"[object Undefined]"
phantomjs>

@vitallium
Copy link
Collaborator

REPL is known to be broken in 1.9.X version.

@kibin
Copy link

kibin commented Jun 16, 2015

Hm, I’m using it with karma, which installs 1.9.X by default. Will try to switch to 2.0, thanks.

@vitallium
Copy link
Collaborator

Fixed in 2.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants