Commit Graph

3 Commits

Author SHA1 Message Date
Frederik Gossen
150a8abaf5 [test] Prevent Unintentionally Undefined Error Types
Ignore the error type in {assertThrows} only if it was not passed as an
argument. If users do not care about the error type they can user the
generic type {Error}. Before this change, an undefined error type would
simply be ignored. A simple typo could therefore disable the error type
assertion without being recognized.

Change-Id: I9becfd0bf14dcaa511854e65ff94f94481cc79b0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585855
Commit-Queue: Frederik Gossen <frgossen@google.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61105}
2019-04-30 08:43:06 +00:00
Toon Verwaest
e167ad823e [parser] Reduce reliance on ExpressionClassifier to detect pattern errors
Rather check expressions used as patterns directly. Check parentheses by
tagging parenthesized expressions as parenthesized.

This allows us to drop UnexpectedPatternToken and makes it clear why a specific
token is unexpected (because it's invalid in a binding pattern).

This also more uniformly restores messages like "Invalid destructuring
assignment target".

Change-Id: Idd98e9116c85de4c2304cf1fef1baa097b67149d
Reviewed-on: https://chromium-review.googlesource.com/c/1349572
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57792}
2018-11-23 16:59:47 +00:00
Marja Hölttä
f128acee3b [parser] Fix import in arrow function parameters.
BUG=chromium:852765

Change-Id: Iaba84f6e52b08b3aee4c1529701239c049dceb9a
Reviewed-on: https://chromium-review.googlesource.com/1128875
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54450}
2018-07-16 07:57:19 +00:00