• 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
..
local-tests/test Loading commit data...
BUILD.gn Loading commit data...
OWNERS Loading commit data...
README Loading commit data...
detachArrayBuffer.js Loading commit data...
harness-adapt-donotevaluate.js Loading commit data...
harness-adapt.js Loading commit data...
harness-agent.js Loading commit data...
harness-ishtmldda.js Loading commit data...
prune-local-tests.sh Loading commit data...
test262.status Loading commit data...
testcfg.py Loading commit data...
upstream-local-tests.sh Loading commit data...