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

JS: small issue with Std.is and Firefox #2297

Closed
mockey opened this issue Nov 6, 2013 · 8 comments
Closed

JS: small issue with Std.is and Firefox #2297

mockey opened this issue Nov 6, 2013 · 8 comments
Assignees
Labels
platform-javascript Everything related to JS / JavaScript
Milestone

Comments

@mockey
Copy link
Contributor

mockey commented Nov 6, 2013

Std.is(elem, Element) returns false for an Element in Firefox, because
typeof Element
returns "object" in Firefox while it returns "function" in WebKit browsers. Modifying the check in js.Boot.__instanceof to:

if( (untyped __js__("typeof"))(cl) == "function" || (untyped __js__("typeof"))(cl) == "object" ) {
  ...

seems to fix this.

@ghost ghost assigned aduros Nov 12, 2013
@aduros
Copy link
Contributor

aduros commented Dec 8, 2013

typeof HTMLElement returns function in Firefox over here?

Std.is(elem, Element) also seems to work as expected.

@ncannasse
Copy link
Member

Seems similar to #2441

@mockey
Copy link
Contributor Author

mockey commented Dec 8, 2013

In my case it was a pretty old version of Firefox (11.0) which returned object.

@aduros
Copy link
Contributor

aduros commented May 13, 2014

Closing this since it seems to affect an old version of one browser. If there are any recent browsers that do this, please reopen.

@aduros aduros closed this as completed May 13, 2014
@mockey
Copy link
Contributor Author

mockey commented May 14, 2014

Safari does this. Here is a proposed fix: #2857

@hexonaut
Copy link
Contributor

It's also the correct behaviour defined in the spec.

@ncannasse ncannasse reopened this May 14, 2014
@aduros
Copy link
Contributor

aduros commented Mar 7, 2015

Too late for 3.2, possible for 3.3.

@aduros aduros modified the milestones: 3.3, 3.2 Mar 7, 2015
@mockey
Copy link
Contributor Author

mockey commented Mar 7, 2015

A fix from me is already merged since last year: #2857. This can be closed.

@aduros aduros closed this as completed Mar 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-javascript Everything related to JS / JavaScript
Projects
None yet
Development

No branches or pull requests

4 participants