Bug 35282 - Old catch-clause scoping bug still unfixed
Summary: Old catch-clause scoping bug still unfixed
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) OS X 10.5
: P2 Normal
Assignee: Nobody
URL: http://google-caja.googlecode.com/svn...
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-22 20:28 PST by Mark S. Miller
Modified: 2010-02-22 21:48 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark S. Miller 2010-02-22 20:28:08 PST
The old ES3 behavior

function foo(){this.x = 11;}
var x = 'bar';
try { throw foo; } catch(e) { e(); print(x); }
// prints 11

is still present, despite 1) violating ES5 semantics, and 2) fatally violates ES5-strict semantics, as much of the motivation of ES5-strict is static scoping. This catch bug prevents static scoping.
Comment 1 Mark S. Miller 2010-02-22 21:48:02 PST
Oops. Thanks to Brendan for the correction. I was thinking about the code example in a nested scope as follows, but I hadn't tested that way. Tested nested, it
works fine. Sorry for the misunderstanding.

(function(){
  function foo(){this.x = 11;}
  var x = 'bar';
  try { throw foo; } catch(e) { e(); print(x); }
})();
// prints bar