• Iain Ireland's avatar
    Reland "[regexp] Rewrite error handling" · 560f2d8b
    Iain Ireland authored
    This is a reland of e80ca24c
    
    Original change's description:
    > [regexp] Rewrite error handling
    >
    > This patch modifies irregexp's error handling. Instead of representing
    > errors as C strings, they are represented as an enumeration value
    > (RegExpError), and only converted to strings when throwing the error
    > object in regexp.cc. This makes it significantly easier to integrate
    > into SpiderMonkey. A few notes:
    >
    > 1. Depending on whether the stack overflows during parsing or
    >    analysis, the stack overflow message can vary ("Stack overflow" or
    >    "Maximum call stack size exceeded"). I kept that behaviour in this
    >    patch, under the assumption that stack overflow messages are
    >    (sadly) the sorts of things that real world code ends up depending
    >    on.
    >
    > 2. Depending on the point in code where the error was identified,
    >    invalid unicode escapes could be reported as "Invalid Unicode
    >    escape", "Invalid unicode escape", or "Invalid Unicode escape
    >    sequence". I fervently hope that nobody depends on the specific
    >    wording of a syntax error, so I standardized on the first one. (It
    >    was both the most common, and the most consistent with other
    >    "Invalid X escape" messages.)
    >
    > 3. In addition to changing the representation, this patch also adds an
    >    error_pos field to RegExpParser and RegExpCompileData, which stores
    >    the position at which an error occurred. This is used by
    >    SpiderMonkey to provide more helpful messages about where a syntax
    >    error occurred in large regular expressions.
    >
    > 4. This model is closer to V8's existing MessageTemplate
    >    infrastructure. I considered trying to integrate it more closely
    >    with MessageTemplate, but since one of our stated goals for this
    >    project was to make it easier to use irregexp outside of V8, I
    >    decided to hold off.
    >
    > R=jgruber@chromium.org
    >
    > Bug: v8:10303
    > Change-Id: I62605fd2def2fc539f38a7e0eefa04d36e14bbde
    > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2091863
    > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#66784}
    
    R=jgruber@chromium.org
    
    Bug: v8:10303
    Change-Id: Iad1f11a0e0b9e525d7499aacb56c27eff9e7c7b5
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2109952Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#66798}
    560f2d8b
Name
Last commit
Last update
..
api Loading commit data...
asmjs Loading commit data...
ast Loading commit data...
base Loading commit data...
builtins Loading commit data...
codegen Loading commit data...
common Loading commit data...
compiler Loading commit data...
compiler-dispatcher Loading commit data...
d8 Loading commit data...
date Loading commit data...
debug Loading commit data...
deoptimizer Loading commit data...
diagnostics Loading commit data...
execution Loading commit data...
extensions Loading commit data...
flags Loading commit data...
handles Loading commit data...
heap Loading commit data...
ic Loading commit data...
init Loading commit data...
inspector Loading commit data...
interpreter Loading commit data...
json Loading commit data...
libplatform Loading commit data...
libsampler Loading commit data...
logging Loading commit data...
numbers Loading commit data...
objects Loading commit data...
parsing Loading commit data...
profiler Loading commit data...
protobuf Loading commit data...
regexp Loading commit data...
roots Loading commit data...
runtime Loading commit data...
sanitizer Loading commit data...
snapshot Loading commit data...
strings Loading commit data...
tasks Loading commit data...
third_party Loading commit data...
torque Loading commit data...
tracing Loading commit data...
trap-handler Loading commit data...
utils Loading commit data...
wasm Loading commit data...
zone Loading commit data...
DEPS Loading commit data...
OWNERS Loading commit data...