• Jakob Gruber's avatar
    [regexp] Early errors 🤯 · a56874d3
    Jakob Gruber authored
    This CL implements early SyntaxErrors for regular expressions. Early
    errors are thrown when a malformed pattern is parsed, rather than when
    the code first runs.
    
    We do this by having the JS parser call into the regexp parser when
    a regexp pattern is found. Regexps are expected to be relatively
    rare, small, and cheap to parse - that's why we currently accept that
    the regexp parser does unnecessary work (e.g. creating the AST
    structures).
    
    If needed, we can optimize in the future. Ideas:
    
    - Split up the regexp parser to avoid useless work for syntax validation.
    - Preserve parser results to avoid reparsing later.
    
    Bug: v8:896
    Change-Id: I3d1ec18c980ba94439576ac3764138552418b85d
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3106647
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
    Reviewed-by: 's avatarPatrick Thier <pthier@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#76502}
    a56874d3
Name
Last commit
Last update
..
DIR_METADATA Loading commit data...
OWNERS Loading commit data...
expression-scope.h Loading commit data...
func-name-inferrer.cc Loading commit data...
func-name-inferrer.h Loading commit data...
import-assertions.cc Loading commit data...
import-assertions.h Loading commit data...
keywords-gen.h Loading commit data...
keywords.txt Loading commit data...
literal-buffer.cc Loading commit data...
literal-buffer.h Loading commit data...
parse-info.cc Loading commit data...
parse-info.h Loading commit data...
parser-base.h Loading commit data...
parser.cc Loading commit data...
parser.h Loading commit data...
parsing.cc Loading commit data...
parsing.h Loading commit data...
pending-compilation-error-handler.cc Loading commit data...
pending-compilation-error-handler.h Loading commit data...
preparse-data-impl.h Loading commit data...
preparse-data.cc Loading commit data...
preparse-data.h Loading commit data...
preparser-logger.h Loading commit data...
preparser.cc Loading commit data...
preparser.h Loading commit data...
rewriter.cc Loading commit data...
rewriter.h Loading commit data...
scanner-character-streams.cc Loading commit data...
scanner-character-streams.h Loading commit data...
scanner-inl.h Loading commit data...
scanner.cc Loading commit data...
scanner.h Loading commit data...
token.cc Loading commit data...
token.h Loading commit data...