W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2011

[Bug 12295] Make `node instanceof otherWindow.Node` evaluate to false

From: <bugzilla@jessica.w3.org>
Date: Wed, 27 Apr 2011 18:10:23 +0000
To: public-script-coord@w3.org
Message-Id: <E1QF9Bv-00074I-AO@jessica.w3.org>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=12295

Mark S. Miller <erights@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |erights@gmail.com

--- Comment #2 from Mark S. Miller <erights@gmail.com> 2011-04-27 18:10:22 UTC ---
(In reply to comment #1)
> It would be nice if this actually evaluated to true, from an author
> perspective, because otherwise "foo instanceof Node" and so on are quite
> confusing in the edge case where you've got an iframe or something.  But I
> guess it's easier to make it false from an interop perspective . . .

In judging the author perspective, you need to consider consistency with the
rest of JavaScript. While it might be nice if '{ } instanceof
otherWindow.Object' or '[] instanceof otherWindow.Array' were true, that's not
the way JavaScript works. 

Further, some of us seek to eventually make the Dom emulatable by Proxies.
While a strawman Proxy extension
http://wiki.ecmascript.org/doku.php?id=strawman:proxy_instanceof could emulate
the behavior you have in mind, the currently accepted proxy proposal
http://wiki.ecmascript.org/doku.php?id=harmony:proxies cannot. Nor can proxies
as currently implemented in FF4 through 6.0a1. (Even if the strawman above does
get approved, consistency still makes me favor that all these cross-frame
instanceof cases be specified to return false.)

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Received on Wednesday, 27 April 2011 18:10:25 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:03 UTC