Prev: FAQ Topic - I have <a href="javascript:somefunction()"> what ... ? (2010-07-12)
Next: Function.prototype broken in IE9pr3
From: Garrett Smith on 12 Jul 2010 02:21 In ECMAScript, a catch block augments the current scope chain by pushing a new Object to the front of the scope chain. However, official versions of JScript up to and including JScript 5.8 don't do that. Instead, when entering a catch block, these versions of JScript add the catch block's parameter to the containing scope. This was fixed in IE9's JScript engine, "JScript 0.9", using, however, I have noticed that functions defined in the catch block don't get the catch block's scope that they're defined in. This is shown in the example below. When augmented is called, `ex` can't be accessed. <!doctype html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>test catch scope</title> </head> <body> <script type="text/javascript"> try { var ex = 12; x; // throw a ReferenceError } catch(ex) { alert(ex.name); var augmented = function() { alert(ex); }; augmented(); } </script> </body> </html> IE9 Results: "ReferenceError", "12". Function `augmented` isn't getting the scope chain from the catch block. Garrett
From: jdalton on 12 Jul 2010 02:33 Nice find. Did you report this bug? The IE dev team has been responsive to my bug reports... ;D
From: Garrett Smith on 12 Jul 2010 02:58 On 2010-07-11 11:33 PM, jdalton wrote: > Nice find. > Did you report this bug? > The IE dev team has been responsive to my bug reports... ;D Nope. Been busy. For example, today, my cat peed and pooped on my bed. What a nice boy. BTW where do you report IE bugs these days? connect.microsoft.com? -- Garrett
From: kangax on 12 Jul 2010 12:43 On 7/12/10 2:58 AM, Garrett Smith wrote: > On 2010-07-11 11:33 PM, jdalton wrote: >> Nice find. >> Did you report this bug? >> The IE dev team has been responsive to my bug reports... ;D > > Nope. Been busy. For example, today, my cat peed and pooped on my bed. > What a nice boy. > > BTW where do you report IE bugs these days? connect.microsoft.com? > https://connect.microsoft.com/IE/Feedback (need to be signed in) -- kangax
From: Garrett Smith on 12 Jul 2010 13:24
On 2010-07-12 09:43 AM, kangax wrote: > On 7/12/10 2:58 AM, Garrett Smith wrote: >> On 2010-07-11 11:33 PM, jdalton wrote: >>> Nice find. >>> Did you report this bug? >>> The IE dev team has been responsive to my bug reports... ;D >> >> Nope. Been busy. For example, today, my cat peed and pooped on my bed. >> What a nice boy. >> >> BTW where do you report IE bugs these days? connect.microsoft.com? >> > > https://connect.microsoft.com/IE/Feedback > > (need to be signed in) > And complete a survey. "Internet Explorer Feedback Participant Survey" How about I answer every question with please fix your site? If I had time. -- Garrett |