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

I tested the first code interactively. No syntax error these days. f(1) => 2; f(2) => ReferenceError; f(3) => crash! At a glance, looks like it's trying to call ToString on the TDZ value or something like that.

dehrenberg@littledan:~/v8/v8$ out/x64.debug/d8 --harmony-sloppy --harmony-sloppy-let
V8 version 4.6.0 (candidate)
d8> function f(x) { switch (x) { case 1: let y = 1; case 2: y = 2; case 3: print(y); } }
undefined
d8> f(1)
2
undefined
d8> f(2)
(d8):1: ReferenceError: y is not defined
function f(x) { switch (x) { case 1: let y = 1; case 2: y = 2; case 3: print(y); } }
                                                                  ^
ReferenceError: y is not defined
    at f ((d8):1:67)
    at (d8):1:1

d8> f(3)
Stacktrace (bbbbbbbb-bbbbbbbb) 0x20ddd6a041e9 (nil):
==== JS stack trace =========================================

Security context: 0x20ddd6a04189 <undefined>
1: DefaultString(aka DefaultString) [native runtime.js:576] [pc=0x3a3f6d8061df] (this=0x20ddd6a04189 <undefined>,h=0x20ddd6a041e9 <the hole>) 2: ToString(aka ToString) [native runtime.js:502] [pc=0x3a3f6d73c10f] (this=0x20ddd6a04189 <undefined>,h=0x20ddd6a041e9 <the hole>) 6: f(aka f) [(d8):1] [pc=0x3a3f6d73bec4] (this=0x20ddd6a04189 <undefined>,x=3) 7: /* anonymous */ [(d8):1] [pc=0x3a3f6d80fe22] (this=0xedc940051f9 <JS Global Object>)

==== Details ================================================

[1]: DefaultString(aka DefaultString) [native runtime.js:576] [pc=0x3a3f6d8061df] (this=0x20ddd6a04189 <undefined>,h=0x20ddd6a041e9 <the hole>) {
  // stack-allocated locals
  var L = 0x20ddd6a04189 <undefined>
  var M = 0x20ddd6a04189 <undefined>
  var J = 0x20ddd6a04189 <undefined>
  var K = 0x20ddd6a04189 <undefined>
  // expression stack (top to bottom)
  [07] : 0x36c3fb133be9 <FixedArray[18]>
  [06] : 8
  [05] : 0x20ddd6a54a01 <String[8]: toString>
  [04] : 0x20ddd6a041e9 <the hole>
--------- s o u r c e   c o d e ---------
function DefaultString(h){\x0aif(!(%_ClassOf(h)==='Symbol')){\x0aif((typeof(h)==='symbol'))throw MakeTypeError(115);\x0avar L=h.toString;\x0aif((%_ClassOf(L)==='Function')){\x0avar M=%_CallFunction(h,L);\x0aif(IsPrimitive(M))return M;\x0a}\x0avar J=h.valueOf;\x0aif((%_ClassOf(J)==='Function')){\x0avar K=%_CallFunction(h,J);\x0aif(IsPrimitive(K))return K...

-----------------------------------------
}

[2]: ToString(aka ToString) [native runtime.js:502] [pc=0x3a3f6d73c10f] (this=0x20ddd6a04189 <undefined>,h=0x20ddd6a041e9 <the hole>) {
  // expression stack (top to bottom)
  [04] : 0x20ddd6a041e9 <the hole>
  [03] : 0x20ddd6a04189 <undefined>
[02] : 0x20ddd6ac9b61 <JS Function DefaultString (SharedFunctionInfo 0x20ddd6a637f9)>
  [01] : 0x20ddd6a04189 <undefined>
[00] : 0x20ddd6ac9a41 <JS Function ToString (SharedFunctionInfo 0x20ddd6a62ee1)>
--------- s o u r c e   c o d e ---------
function ToString(h){\x0aif((typeof(h)==='string'))return h;\x0aif((typeof(h)==='number'))return %_NumberToString(h);\x0aif((typeof(h)==='boolean'))return h?'true':'false';\x0aif((h===(void 0)))return'undefined';\x0areturn((h===null))?'null':ToString(DefaultString(h));\x0a}
-----------------------------------------
}

[6]: f(aka f) [(d8):1] [pc=0x3a3f6d73bec4] (this=0x20ddd6a04189 <undefined>,x=3) {
  // stack-allocated locals
  var y = 0x20ddd6a041e9 <the hole>
  // expression stack (top to bottom)
[04] : 0x20ddd6ae6639 <JS Function print (SharedFunctionInfo 0x20ddd6ae65a1)>
  [03] : 0x20ddd6a041e9 <the hole>
  [02] : 0xedc940051f9 <JS Global Object>
[01] : 0x20ddd6ae6639 <JS Function print (SharedFunctionInfo 0x20ddd6ae65a1)>
--------- s o u r c e   c o d e ---------
function f(x) { switch (x) { case 1: let y = 1; case 2: y = 2; case 3: print(y); } }
-----------------------------------------
}

[7]: /* anonymous */ [(d8):1] [pc=0x3a3f6d80fe22] (this=0xedc940051f9 <JS Global Object>) {
  // stack-allocated locals
  var .result = 0x20ddd6a04189 <undefined>
  // expression stack (top to bottom)
  [03] : 3
  [02] : 0x20ddd6a04189 <undefined>
  [01] : 0x36c3fb12e499 <JS Function f (SharedFunctionInfo 0x36c3fb12e249)>
--------- s o u r c e   c o d e ---------
f(3)
-----------------------------------------
}

=====================



--
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