Bug 83437 - Command-line jsc's exception handling should be rationalized
Summary: Command-line jsc's exception handling should be rationalized
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-08 13:10 PDT by Filip Pizlo
Modified: 2012-04-08 13:51 PDT (History)
0 users

See Also:


Attachments
the patch (3.51 KB, patch)
2012-04-08 13:15 PDT, Filip Pizlo
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2012-04-08 13:10:01 PDT
Currently it will swallow and ignore exceptions thrown during a run() execution.  If a program terminates because of an exception, the exception is not printed by default.  It is only printed if we enable bytecode dumping.  It should be enabled always.  The backtrace is never printed even though we almost always have one.
Comment 1 Filip Pizlo 2012-04-08 13:15:58 PDT
Created attachment 136156 [details]
the patch
Comment 2 mitz 2012-04-08 13:45:21 PDT
Comment on attachment 136156 [details]
the patch

View in context: https://bugs.webkit.org/attachment.cgi?id=136156&action=review

> Source/JavaScriptCore/jsc.cpp:532
>          if (dump) {
> -            if (evaluationException)
> -                printf("Exception: %s\n", evaluationException.toString(globalObject->globalExec())->value(globalObject->globalExec()).utf8().data());
> -            else
> +            if (!evaluationException)

Now that there’s no else clause inside you can just write
    if (dump && !evaluationException)
Comment 3 Filip Pizlo 2012-04-08 13:46:19 PDT
(In reply to comment #2)
> (From update of attachment 136156 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=136156&action=review
> 
> > Source/JavaScriptCore/jsc.cpp:532
> >          if (dump) {
> > -            if (evaluationException)
> > -                printf("Exception: %s\n", evaluationException.toString(globalObject->globalExec())->value(globalObject->globalExec()).utf8().data());
> > -            else
> > +            if (!evaluationException)
> 
> Now that there’s no else clause inside you can just write
>     if (dump && !evaluationException)

Good point, thanks for the review!
Comment 4 Filip Pizlo 2012-04-08 13:51:21 PDT
Landed in http://trac.webkit.org/changeset/113553