Ignore:
Timestamp:
Nov 22, 2018, 5:33:40 PM (7 years ago)
Author:
[email protected]
Message:

Make the jsc shell's dumpException() more robust against long exception strings.
https://bugs.webkit.org/show_bug.cgi?id=191910
<rdar://problem/46212980>

Reviewed by Michael Saboff.

This only affects the dumping of the exception string in the jsc shell due to
unhandled exceptions or exceptions at shell boot time before any JS code is
running.

  • jsc.cpp:

(dumpException):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r238391 r238453  
    23032303    } while (false)
    23042304
    2305     printf("Exception: %s\n", exception.toWTFString(globalObject->globalExec()).utf8().data());
     2305    auto exceptionString = exception.toWTFString(globalObject->globalExec());
     2306    Expected<CString, UTF8ConversionError> expectedCString = exceptionString.tryGetUtf8();
     2307    if (expectedCString)
     2308        printf("Exception: %s\n", expectedCString.value().data());
     2309    else
     2310        printf("Exception: <out of memory while extracting exception string>\n");
    23062311
    23072312    Identifier nameID = Identifier::fromString(globalObject->globalExec(), "name");
Note: See TracChangeset for help on using the changeset viewer.