1. 16 Jun, 2017 1 commit
  2. 15 Jun, 2017 1 commit
    • Sathya Gunasekaran's avatar
      [parser] Better error message when destructuring against undefined/null · bc2c785c
      Sathya Gunasekaran authored
      Previously, when destructuring against null or undefined we would
      print:
      
        d8> var { x } = null
        (d8):1: TypeError: Cannot match against 'undefined' or 'null'.
        var { x } = null
        ^
        TypeError: Cannot match against 'undefined' or 'null'.
            at (d8):1:1
      
      
      The above message uses the term "match" which isn't a common term in
      JavaScript to describe destructuring. This message also doesn't
      provide the name of the property that fails destructuring.
      
      This patch changes the error message to be:
      
        d8> var { x } = null;
        (d8):1: TypeError: Cannot destructure property `x` of 'undefined' or 'null'.
        var { x } = null;
              ^
        TypeError: Cannot destructure property `x` of 'undefined' or 'null'.
            at (d8):1:1
      
      This patch changes the message to say "destructure" instead of "match".
      
      This patch adds support for printing property names that are string
      literals. We iterate through every property and pick the first string
      literal property name if it exists. This provides at least some
      feedback to the developer.
      
      This patch also makes the pointer point to the position of the
      property name that fails destructuring.
      
      For computed and numeric property names, we print a generic error:
        d8> var { 1: x } = null
        (d8):1: TypeError: Cannot destructure against 'undefined' or 'null'.
        var { 1: x } = null
        ^
        TypeError: Cannot destructure against 'undefined' or 'null'.
            at (d8):1:1
      
      Bug: v8:6499
      Change-Id: I35b1ac749489828686f042975294b9926e2dfc53
      Reviewed-on: https://chromium-review.googlesource.com/537341Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
      Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#45965}
      bc2c785c
  3. 12 Jun, 2017 1 commit
  4. 19 May, 2017 1 commit
  5. 04 May, 2017 2 commits
  6. 24 Apr, 2017 1 commit
  7. 19 Apr, 2017 1 commit
  8. 18 Apr, 2017 2 commits
  9. 14 Apr, 2017 1 commit
  10. 12 Apr, 2017 1 commit
  11. 06 Apr, 2017 1 commit
  12. 29 Mar, 2017 1 commit
  13. 28 Mar, 2017 3 commits
    • jgruber's avatar
      [regexp] Named capture support for string replacements · 9403edfa
      jgruber authored
      This implements support for named captures in
      RegExp.prototype[@@replace] for when the replaceValue is not callable.
      
      Named captures can be referenced from replacement strings by using the
      "$<name>" syntax. A couple of examples:
      
      let re = /(?<fst>.)(?<snd>.)/u;
      "abcd".replace(re, "$<snd>$<fst>")  // "bacd"
      "abcd".replace(re, "$2$1")     // "bacd" (numbered refs work as always)
      "abcd".replace(re, "$<snd")    // SyntaxError (unterminated named ref)
      "abcd".replace(re, "$<42$1>")  // "cd" (invalid name)
      "abcd".replace(re, "$<thd>")   // "cd" (non-existent name)
      "abcd".replace(/(?<fst>.)|(?<snd>.)/u, "$<snd>")  // "cd" (non-matched capture)
      
      Support is currently behind the --harmony-regexp-named-captures flag.
      
      BUG=v8:5437
      
      Review-Url: https://codereview.chromium.org/2775303002
      Cr-Original-Commit-Position: refs/heads/master@{#44171}
      Committed: https://chromium.googlesource.com/v8/v8/+/17f13863b64b25eccf565e0aa9c4c441f0562b84
      Review-Url: https://codereview.chromium.org/2775303002
      Cr-Commit-Position: refs/heads/master@{#44182}
      9403edfa
    • jgruber's avatar
      Revert of [regexp] Named capture support for string replacements (patchset #5... · 34ffdd62
      jgruber authored
      Revert of [regexp] Named capture support for string replacements (patchset #5 id:80001 of https://codereview.chromium.org/2775303002/ )
      
      Reason for revert:
      Invalid DCHECKs for non-matched groups.
      
      Original issue's description:
      > [regexp] Named capture support for string replacements
      >
      > This implements support for named captures in
      > RegExp.prototype[@@replace] for when the replaceValue is not callable.
      >
      > Named captures can be referenced from replacement strings by using the
      > "$<name>" syntax. A couple of examples:
      >
      > let re = /(?<fst>.)(?<snd>.)/u;
      > "abcd".replace(re, "$<snd>$<fst>")  // "bacd"
      > "abcd".replace(re, "$2$1")     // "bacd" (numbered refs work as always)
      > "abcd".replace(re, "$<snd")    // SyntaxError (unterminated named ref)
      > "abcd".replace(re, "$<42$1>")  // "cd" (invalid name)
      > "abcd".replace(re, "$<thd>")   // "cd" (non-existent name)
      > "abcd".replace(/(?<fst>.)|(?<snd>.)/u, "$<snd>")  // "cd" (non-matched capture)
      >
      > Support is currently behind the --harmony-regexp-named-captures flag.
      >
      > BUG=v8:5437
      >
      > Review-Url: https://codereview.chromium.org/2775303002
      > Cr-Commit-Position: refs/heads/master@{#44171}
      > Committed: https://chromium.googlesource.com/v8/v8/+/17f13863b64b25eccf565e0aa9c4c441f0562b84
      
      TBR=yangguo@chromium.org,littledan@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=v8:5437
      
      Review-Url: https://codereview.chromium.org/2776293003
      Cr-Commit-Position: refs/heads/master@{#44180}
      34ffdd62
    • jgruber's avatar
      [regexp] Named capture support for string replacements · 17f13863
      jgruber authored
      This implements support for named captures in
      RegExp.prototype[@@replace] for when the replaceValue is not callable.
      
      Named captures can be referenced from replacement strings by using the
      "$<name>" syntax. A couple of examples:
      
      let re = /(?<fst>.)(?<snd>.)/u;
      "abcd".replace(re, "$<snd>$<fst>")  // "bacd"
      "abcd".replace(re, "$2$1")     // "bacd" (numbered refs work as always)
      "abcd".replace(re, "$<snd")    // SyntaxError (unterminated named ref)
      "abcd".replace(re, "$<42$1>")  // "cd" (invalid name)
      "abcd".replace(re, "$<thd>")   // "cd" (non-existent name)
      "abcd".replace(/(?<fst>.)|(?<snd>.)/u, "$<snd>")  // "cd" (non-matched capture)
      
      Support is currently behind the --harmony-regexp-named-captures flag.
      
      BUG=v8:5437
      
      Review-Url: https://codereview.chromium.org/2775303002
      Cr-Commit-Position: refs/heads/master@{#44171}
      17f13863
  14. 27 Mar, 2017 1 commit
  15. 25 Mar, 2017 1 commit
  16. 23 Mar, 2017 2 commits
  17. 14 Mar, 2017 1 commit
  18. 16 Feb, 2017 2 commits
    • jwolfe's avatar
      Implement new Function.prototype.toString --harmony-function-tostring · d1d4b9ce
      jwolfe authored
      For functions declared in source code, the .toString() representation
      will be an excerpt of the source code.
      * For functions declared with the "function" keyword, the excerpt
        starts at the "function" or "async" keyword and ends at the final "}".
        The previous behavior would start the excerpt at the "(" of the
        parameter list, and prepend a canonical `"function " + name` or
        similar, which would discard comments and formatting surrounding the
        function's name. Anonymous functions declared as function expressions
        no longer get the name "anonymous" in their toString representation.
      * For methods, the excerpt starts at the "get", "set", "*" (for
        generator methods), or property name, whichever comes first.
        Previously, the toString representation for methods would use a
        canonical prefix before the "(" of the parameter list. Note that any
        "static" keyword is omitted.
      * For arrow functions and class declarations, the excerpt is unchanged.
      
      For functions created with the Function, GeneratorFunction, or
      AsyncFunction constructors:
      * The string separating the parameter text and body text is now
        "\n) {\n", where previously it was "\n/*``*/) {\n" or ") {\n".
      * At one point, newline normalization was required by the spec here,
        but that was removed from the spec, and so this CL does not do it.
      
      Included in this CL is a fix for CreateDynamicFunction parsing. ')'
      and '`' characters in the parameter string are no longer disallowed,
      and Function("a=function(", "}){") is no longer allowed.
      
      BUG=v8:4958, v8:4230
      
      Review-Url: https://codereview.chromium.org/2156303002
      Cr-Commit-Position: refs/heads/master@{#43262}
      d1d4b9ce
    • vabr's avatar
      Raise SyntaxError on let [ starting an ExpressionStatement · 94bf354a
      vabr authored
      ES2017 forbids the sequence of tokens "let [" in in expression statements [1].
      
      This CL makes ParserBase report those instances as SyntaxError. It also adds a
      customised error message for that, because the standard "Unexpected token" is
      not applicable: "let" itself is not forbidden in those context, only the
      sequence of "let [".
      
      [1] https://tc39.github.io/ecma262/#sec-expression-statement
      
      BUG=v8:5686
      
      Review-Url: https://codereview.chromium.org/2694003002
      Cr-Commit-Position: refs/heads/master@{#43258}
      94bf354a
  19. 15 Feb, 2017 1 commit
  20. 14 Feb, 2017 1 commit
  21. 13 Feb, 2017 6 commits
  22. 01 Feb, 2017 1 commit
  23. 27 Jan, 2017 1 commit
  24. 23 Jan, 2017 1 commit
  25. 18 Jan, 2017 1 commit
    • gsathya's avatar
      [ESnext] Implement Object Rest · 54b5c4b8
      gsathya authored
      This rewrites the rest property into a runtime call which sets up the
      correct properties in the newly created object.
      
      - Changes flag to --harmony-object-rest-spread
      - Changes pattern rewriter to desugar rest property
      - Adds new runtime function CopyDataPropertiesWithExcludedProperties
      
      BUG=v8:5549
      
      Review-Url: https://codereview.chromium.org/2620943002
      Cr-Commit-Position: refs/heads/master@{#42430}
      54b5c4b8
  26. 13 Jan, 2017 1 commit
  27. 12 Jan, 2017 1 commit
  28. 06 Jan, 2017 1 commit
  29. 05 Jan, 2017 1 commit