<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Capture this!</title>
	<atom:link href="http://www.weaselhat.com/2007/03/14/js-this/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.weaselhat.com/2007/03/14/js-this/</link>
	<description></description>
	<lastBuildDate>Tue, 25 Oct 2011 15:23:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Michael Greenberg</title>
		<link>http://www.weaselhat.com/2007/03/14/js-this/comment-page-1/#comment-74</link>
		<dc:creator>Michael Greenberg</dc:creator>
		<pubDate>Sun, 29 Apr 2007 03:15:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.weaselhat.com/2007/03/14/js-this/#comment-74</guid>
		<description>Ah.  That&#039;s a relief that it&#039;s a bug.  I think the behavior itself is weird, and that dotting should either always or never capture this.

Thanks for looking back into this!</description>
		<content:encoded><![CDATA[<p>Ah.  That&#8217;s a relief that it&#8217;s a bug.  I think the behavior itself is weird, and that dotting should either always or never capture this.</p>
<p>Thanks for looking back into this!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Herman</title>
		<link>http://www.weaselhat.com/2007/03/14/js-this/comment-page-1/#comment-73</link>
		<dc:creator>Dave Herman</dc:creator>
		<pubDate>Sat, 28 Apr 2007 20:38:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.weaselhat.com/2007/03/14/js-this/#comment-73</guid>
		<description>Okay, it turns out I was wrong and this has nothing to do with the new behavior of `this&#039; in ES4 -- Mozilla has not implemented that yet.

Brendan Eich informs me that it&#039;s a bug that&#039;s been fixed in alpha versions of Firefox/SpiderMonkey:

&quot;[this example] changed behavior from Firefox 2 (the mozilla 1.8 branch) to Minefield (alpha Firefox 3, the 1.9 cvs trunk). My trunk js shell gives false, my 1.8 branch shell gives true in agreement with Firefox 2.0.0.x.

This looks like a bug fix due to Igor&#039;s work in https://bugzilla.mozilla.org/show_bug.cgi?id=363530.&quot;

He&#039;s referring to `c.bar()()&#039; returning true or false, BTW. It should return `false&#039;.</description>
		<content:encoded><![CDATA[<p>Okay, it turns out I was wrong and this has nothing to do with the new behavior of `this&#8217; in ES4 &#8212; Mozilla has not implemented that yet.</p>
<p>Brendan Eich informs me that it&#8217;s a bug that&#8217;s been fixed in alpha versions of Firefox/SpiderMonkey:</p>
<p>&#8220;[this example] changed behavior from Firefox 2 (the mozilla 1.8 branch) to Minefield (alpha Firefox 3, the 1.9 cvs trunk). My trunk js shell gives false, my 1.8 branch shell gives true in agreement with Firefox 2.0.0.x.</p>
<p>This looks like a bug fix due to Igor&#8217;s work in <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=363530." rel="nofollow">https://bugzilla.mozilla.org/show_bug.cgi?id=363530.</a>&#8221;</p>
<p>He&#8217;s referring to `c.bar()()&#8217; returning true or false, BTW. It should return `false&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Herman</title>
		<link>http://www.weaselhat.com/2007/03/14/js-this/comment-page-1/#comment-72</link>
		<dc:creator>Dave Herman</dc:creator>
		<pubDate>Fri, 27 Apr 2007 18:50:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.weaselhat.com/2007/03/14/js-this/#comment-72</guid>
		<description>I think I found it. Look at

http://developer.mozilla.org/es4/proposals/bug_fixes.html

and search for &quot;[THIS.PROPAGATES]&quot;.</description>
		<content:encoded><![CDATA[<p>I think I found it. Look at</p>
<p><a href="http://developer.mozilla.org/es4/proposals/bug_fixes.html" rel="nofollow">http://developer.mozilla.org/es4/proposals/bug_fixes.html</a></p>
<p>and search for &#8220;[THIS.PROPAGATES]&#8220;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Herman</title>
		<link>http://www.weaselhat.com/2007/03/14/js-this/comment-page-1/#comment-71</link>
		<dc:creator>Dave Herman</dc:creator>
		<pubDate>Fri, 27 Apr 2007 17:42:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.weaselhat.com/2007/03/14/js-this/#comment-71</guid>
		<description>D&#039;oh! I missed the part where they disagree: `foo.bar()()&#039;. Sorry I posted too soon before I read more carefully.

I still need to double-check where this divergence in behavior comes from.</description>
		<content:encoded><![CDATA[<p>D&#8217;oh! I missed the part where they disagree: `foo.bar()()&#8217;. Sorry I posted too soon before I read more carefully.</p>
<p>I still need to double-check where this divergence in behavior comes from.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Herman</title>
		<link>http://www.weaselhat.com/2007/03/14/js-this/comment-page-1/#comment-70</link>
		<dc:creator>Dave Herman</dc:creator>
		<pubDate>Fri, 27 Apr 2007 17:40:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.weaselhat.com/2007/03/14/js-this/#comment-70</guid>
		<description>I&#039;m looking at this again and I&#039;m confused now. What is the problem with this example? All three major browsers agree on the behavior.

The binding of `this&#039; in JS is determined by the syntax of the function call. When you said `c.bar()&#039; you invoked `bar&#039; as a method of `c&#039;, so it bound `this&#039; to `c&#039; for the evaluation of the body of `bar&#039;. But when you then called `foo&#039; as a naked function, it bound `this&#039; to the global object.

That&#039;s the stated, specified behavior of JavaScript. Are you claiming there&#039;s an inconsistency between browsers/implementations of JS, or just that the specified behavior is weird? (If it&#039;s the latter, you&#039;ll get no disagreement from me.)</description>
		<content:encoded><![CDATA[<p>I&#8217;m looking at this again and I&#8217;m confused now. What is the problem with this example? All three major browsers agree on the behavior.</p>
<p>The binding of `this&#8217; in JS is determined by the syntax of the function call. When you said `c.bar()&#8217; you invoked `bar&#8217; as a method of `c&#8217;, so it bound `this&#8217; to `c&#8217; for the evaluation of the body of `bar&#8217;. But when you then called `foo&#8217; as a naked function, it bound `this&#8217; to the global object.</p>
<p>That&#8217;s the stated, specified behavior of JavaScript. Are you claiming there&#8217;s an inconsistency between browsers/implementations of JS, or just that the specified behavior is weird? (If it&#8217;s the latter, you&#8217;ll get no disagreement from me.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Stowell</title>
		<link>http://www.weaselhat.com/2007/03/14/js-this/comment-page-1/#comment-61</link>
		<dc:creator>Dan Stowell</dc:creator>
		<pubDate>Wed, 18 Apr 2007 17:52:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.weaselhat.com/2007/03/14/js-this/#comment-61</guid>
		<description>The OL compiler doesn&#039;t touch that bit of script, so the results I gave in the first comment are how ActionScript behaves. So c.bar() returns a function closed over a different `this`?</description>
		<content:encoded><![CDATA[<p>The OL compiler doesn&#8217;t touch that bit of script, so the results I gave in the first comment are how ActionScript behaves. So c.bar() returns a function closed over a different `this`?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Stowell</title>
		<link>http://www.weaselhat.com/2007/03/14/js-this/comment-page-1/#comment-59</link>
		<dc:creator>Dan Stowell</dc:creator>
		<pubDate>Wed, 18 Apr 2007 11:31:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.weaselhat.com/2007/03/14/js-this/#comment-59</guid>
		<description>I compiled your test code to ActionScript with the OpenLaszlo compiler - the results are actually from Flash 8, though I&#039;ll have to track down the code our compiler emits to see whose fault it is.</description>
		<content:encoded><![CDATA[<p>I compiled your test code to ActionScript with the OpenLaszlo compiler &#8211; the results are actually from Flash 8, though I&#8217;ll have to track down the code our compiler emits to see whose fault it is.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Greenberg</title>
		<link>http://www.weaselhat.com/2007/03/14/js-this/comment-page-1/#comment-57</link>
		<dc:creator>Michael Greenberg</dc:creator>
		<pubDate>Tue, 17 Apr 2007 15:36:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.weaselhat.com/2007/03/14/js-this/#comment-57</guid>
		<description>Are you sure you&#039;re running in the latest Firefox?  Dave Herman said that it&#039;s an EC4 feature; it might only be in the latest versions of Spidermonkey.</description>
		<content:encoded><![CDATA[<p>Are you sure you&#8217;re running in the latest Firefox?  Dave Herman said that it&#8217;s an EC4 feature; it might only be in the latest versions of Spidermonkey.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Stowell</title>
		<link>http://www.weaselhat.com/2007/03/14/js-this/comment-page-1/#comment-56</link>
		<dc:creator>Dan Stowell</dc:creator>
		<pubDate>Tue, 17 Apr 2007 14:50:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.weaselhat.com/2007/03/14/js-this/#comment-56</guid>
		<description>OpenLaszlo gets this wronger (but perhaps more consistently):

c.foo() true 
c.bar()() false 
foo() false</description>
		<content:encoded><![CDATA[<p>OpenLaszlo gets this wronger (but perhaps more consistently):</p>
<p>c.foo() true<br />
c.bar()() false<br />
foo() false</p>
]]></content:encoded>
	</item>
</channel>
</rss>

