1. 16 Jan, 2019 1 commit
  2. 02 Aug, 2016 1 commit
    • adamk's avatar
      Sloppy eval declarations should not shadow lexical function declarations · 83b63c30
      adamk authored
      This was being allowed due to the use of BindingFlags instead of VariableMode
      to determine whether a looked-up binding was lexical. Because function
      declarations are hoisted, they never need hole checks, and so were being
      miscategorized as non-lexical.
      
      This patch augments Context::Lookup with a VariableMode out param, which
      allows this check to determine precisely whether the binding is lexical.
      
      BUG=v8:4454, v8:5256
      
      Review-Url: https://codereview.chromium.org/2206483004
      Cr-Commit-Position: refs/heads/master@{#38260}
      83b63c30
  3. 14 Jul, 2016 1 commit
  4. 21 Jun, 2016 1 commit
  5. 13 Jun, 2016 2 commits
    • littledan's avatar
      Revert of change most cases of variable redeclaration from TypeError to... · 85c2c8d8
      littledan authored
      Revert of change most cases of variable redeclaration from TypeError to SyntaxError (patchset #8 id:140001 of https://codereview.chromium.org/2048703002/ )
      
      Reason for revert:
      This is going to break the LayoutTest inspector-protocol/console/console-let-const-with-api.html as seen in https://build.chromium.org/p/tryserver.v8/builders/v8_linux_blink_rel/builds/2247 . Please run this test manually, using instructions at https://www.chromium.org/developers/testing/webkit-layout-tests , and fix on the Chrome side if needed before resubmitting this patch.
      
      Original issue's description:
      > change most cases of variable redeclaration from TypeError to SyntaxError.
      >
      > Code like `let a; eval("var a;");` should throw a SyntaxError, not a TypeError
      > (this caused a test262 failure.). However, the code `eval("function NaN() {}");`
      > should actually throw a TypeError. This patch changes most cases of
      > redeclaration errors from TypeError to SyntaxError. See the test
      > mjsunit/regress/redeclaration-error-types for a thorough analysis with spec
      > references.
      >
      > The relevant sections of the spec are ES#sec-globaldeclarationinstantiation and
      > ES#sec-evaldeclarationinstantiation
      >
      > BUG=v8:4955
      > LOG=y
      >
      > Committed: https://crrev.com/2b787561763d0f7e8dab698652715a742cf78291
      > Cr-Commit-Position: refs/heads/master@{#36940}
      
      TBR=adamk@chromium.org,jwolfe@igalia.com
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=v8:4955
      
      Review-Url: https://codereview.chromium.org/2064793002
      Cr-Commit-Position: refs/heads/master@{#36941}
      85c2c8d8
    • jwolfe's avatar
      change most cases of variable redeclaration from TypeError to SyntaxError. · 2b787561
      jwolfe authored
      Code like `let a; eval("var a;");` should throw a SyntaxError, not a TypeError
      (this caused a test262 failure.). However, the code `eval("function NaN() {}");`
      should actually throw a TypeError. This patch changes most cases of
      redeclaration errors from TypeError to SyntaxError. See the test
      mjsunit/regress/redeclaration-error-types for a thorough analysis with spec
      references.
      
      The relevant sections of the spec are ES#sec-globaldeclarationinstantiation and
      ES#sec-evaldeclarationinstantiation
      
      BUG=v8:4955
      LOG=y
      
      Review-Url: https://codereview.chromium.org/2048703002
      Cr-Commit-Position: refs/heads/master@{#36940}
      2b787561
  6. 08 Apr, 2016 1 commit
  7. 22 Mar, 2016 1 commit
    • adamk's avatar
      Remove support for legacy const, part 1 · ed18aa65
      adamk authored
      Now that ES2015 const has shipped, in Chrome 49, legacy const declarations
      are no more. This lets us remove a bunch of code from many parts of the
      codebase.
      
      In this patch, I remove parser support for generating legacy const variables
      from const declarations. This also removes the special "illegal declaration"
      bit from Scope, which has ripples into all compiler backends.
      
      Also gone are any tests which relied on legacy const declarations.
      
      Note that we do still generate a Variable in mode CONST_LEGACY in one case:
      function name bindings in sloppy mode. The likely fix there is to add a new
      Variable::Kind for this case and handle it appropriately for stores in each
      backend, but I leave that for a later patch to make this one completely
      subtractive.
      
      Review URL: https://codereview.chromium.org/1819123002
      
      Cr-Commit-Position: refs/heads/master@{#35002}
      ed18aa65
  8. 13 Nov, 2015 1 commit
    • adamk's avatar
      Fix harmony sloppy block scoping dynamic redeclaration check · fd3ff03d
      adamk authored
      The previous code did not properly check for harmony const when
      doing the dynamic redeclaration check. This was masked in the
      test because each eval had an initializer, and the initializer was what
      triggered the exception.
      
      This patch tightens the test by removing initializers and fixes the bug in
      DeclareLookupSlot.
      
      Also change the test to use assertThrows where possible.
      
      BUG=v8:4550
      LOG=n
      
      Review URL: https://codereview.chromium.org/1437003006
      
      Cr-Commit-Position: refs/heads/master@{#31995}
      fd3ff03d
  9. 12 Oct, 2015 1 commit
    • littledan's avatar
      Test for var declarations in eval which conflict with let · d515e513
      littledan authored
      Previously, name conflicts between var and let declarations were only
      made into exceptions if they were visible at parse-time. This patch adds
      runtime checks so that sloppy-mode direct eval can't introduce conflicting
      var declarations. The change is implemented by traversing the scope chain
      when a direct eval introduces a var declaration to look for conflicting
      let declarations, up to the function boundary.
      
      BUG=v8:4454
      R=adamk
      LOG=Y
      
      Review URL: https://codereview.chromium.org/1382513003
      
      Cr-Commit-Position: refs/heads/master@{#31211}
      d515e513