1. 25 Nov, 2015 2 commits
    • adamk's avatar
      [es6] Self-assignment in a default parameter initializer should throw · b6e9f625
      adamk authored
      The first bug was that there are two different "initialization positions"
      passed into PatternRewriter::DeclareAndInitializeVariables, and we weren't
      setting them all properly for this case.
      
      After further code review, it became clear that we weren't even recording
      the correct position (the end of the initializer expression).
      
      The combination of those two bugs caused the hole check elimination code
      in full-codegen to skip emitting a hole check.
      
      This patch takes care of both of those things. A follow-up will try
      to reduce the number of "initializer positions" we track in the
      variable declaration code.
      
      R=littledan@chromium.org
      BUG=v8:4568
      LOG=n
      
      Review URL: https://codereview.chromium.org/1468143004
      
      Cr-Commit-Position: refs/heads/master@{#32237}
      b6e9f625
    • adamk's avatar
      Disallow destructuring in legacy sloppy for-in loop parsing · ceb92ebf
      adamk authored
      For web compat reasons, we support an initializer in the declaration
      part of a for-in loop. But we should disallow this for destructured
      declarations (just as we do for lexical declarations). In fact, without
      disallowing it, we crash.
      
      Also fix up the PreParser to have the same restrictions here as the parser
      (the lexical check was missing there), verified by running the message tests
      with --min-preparse-length=0.
      
      In fixing the logic I've also cleaned up the code a bit, removing the
      only-called-once DeclarationParsingResult::SingleName method.
      
      BUG=v8:811
      LOG=n
      
      Review URL: https://codereview.chromium.org/1471973003
      
      Cr-Commit-Position: refs/heads/master@{#32236}
      ceb92ebf
  2. 24 Nov, 2015 38 commits