-
Notifications
You must be signed in to change notification settings - Fork 77
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
Try blocks not identified as scope level #57
Comments
var x = 16
try {
var x = 15
} catch (err) {}
console.log(x) //=> 15 in node im seeing an error for
however with
|
referencing the ES6 meta issue #33 |
node (V8) doesn't implement const properly. |
a fork in the js consensus! quick buy more ASIC v8 miners to gain quorum! wait i must be lost |
hmm that does make things a bit tricky -- what behavior do we track? the spec? or the most common runtime's behavior? |
I think this is the relevant v8 issue: https://code.google.com/p/v8/issues/detail?id=2198&q=const%20scope&colspec=ID%20Type%20Status%20Priority%20Owner%20Summary%20HW%20OS%20Area%20Stars
|
Well, it's not "most common", it was just something not implemented in one particular engine yet, so yes, we should always strive for the spec compatibility. Closing as it looks like non-bug to me. |
Re-opening until we can confirm that all blocks are given a scope, including try, catch, and finally. |
@michaelficarra If that's the goal (all blocks), it's much broader issue than current one. Can you please submit it as a separate issue? |
Fine, just these three. All blocks is just generally related to correctness, so we'll assume they work until we hear otherwise. |
@michaelficarra In that case, what's special about those that we would want to create scopes for them even when they're redundant? |
@RReverser What's redundant about these blocks? They each create a scope object. |
@michaelficarra Regular blocks do as well. I'm suggesting that we keep consistency and either create scope objects for any blocks or keep current behavior where scopes are created for functions + only those blocks that actually have block-scoped variables. |
@RReverser Yeah, I was assuming we'd keep the current behaviour. If you look at the original example, it is claiming that we're not representing the try scope, even though it has a block-scoped declaration ( |
@michaelficarra Ah, I see where the misunderstanding came from. Agreed, that's a bug. |
As far as I can tell after peaking at the spec,
try
blocks should also be included in the scopes whilecatch
andfinally
shouldn't. Howeverescope
only creates adds a scope forcatch
blocksThe text was updated successfully, but these errors were encountered: