ericmckean / traceur-compiler

Automatically exported from code.google.com/p/traceur-compiler
Apache License 2.0
0 stars 0 forks source link

Generated let code coalesce variable declarations #198

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Given:

{
  let x = y;
  let y = 42;
}

we get:

{
  try {
    throw undefined;
  } catch (y) {
    try {
      throw undefined;
    } catch (x) {
      x = y;
      y = 42;
    }
  }
}

If we are going to continue to use try/catch to emulate let we should at least 
change it to:

{
  try {
    throw undefined;
  } catch (x) {
    x = y;
    try {
      throw undefined;
    } catch (y) {
      y = 42;
    }
  }
}

so that we get the temporary dead zone correct.

Original issue reported on code.google.com by arv@google.com on 4 Feb 2013 at 2:29

GoogleCodeExporter commented 9 years ago
Issue 214 has been merged into this issue.

Original comment by arv@chromium.org on 5 Mar 2013 at 5:04