https://codereview.chromium.org/264333007/diff/150001/src/parser.cc#newcode3863
> > src/parser.cc:3863: isolate()->Throw(*result, &location);
> > Won't Debug::OnException trigger as well? The call to
Debug::OnCompileError
> > doesn't actually contain the syntax error location, right? So you
would
need
> the
> > following Debug::OnException to get the actual syntax error location,
right?
A
> > split API like that is kind of weird.
> Yes, I need the following Debug::OnException. But it is important to
distinguish
> between an Exception like SyntaxError and compilation errors. Event
CompileError
> dual event AfterCompile and provides information about the script to
debugger.
Now I'm a bit confused. Aren't syntax errors a subset of compilation
errors?
In
any case, wouldn't you know the current script object from the previous
OnBeforeCompile event? It sounds to me that what we ideally want is to
have
the
script object piggybacked onto the OnException event.
First of all Debug::OnException might not trigger (it is only used
for "pause on
exception" functionality, so in general case it is turned off.
See
https://code.google.com/p/chromium/codesearch#chromium/src/v8/src/debug.cc&q=debug.cc&sq=package:chromium&type=cs&l=2595
Then there could some exotic cases like
try {
eval("}")
} catch (e) {}
where syntax errors are not reported to the embedder at all.
So if we want to distinguish between compiled scripts and scripts where
compilation failed we need an explicit signal about compilation failures.
https://chromiumcodereview.appspot.com/264333007/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.