Status: Accepted
Owner: [email protected]
CC: [email protected]
Labels: Type-Bug Priority-Medium HW-All Harmony OS-All

New issue 3926 by [email protected]: Let/const in CaseBlock
https://code.google.com/p/v8/issues/detail?id=3926

We currently do not correctly handle let/const/function declarations with harmony-scoping in case blocks.

function f(x) {
  switch (x) {
    case 1:
      let y = 1;
    case 2:
      y = 2;
    case 3:
      print(y);
  }
}
f(1); // 2
f(2); // 1;
f(3); // undefined

Instead we throw a SyntaxError. Oops.

The way to think about this is that the switch (x ) { ... } is a block.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to