Changeset 205387 in webkit for trunk/Source/JavaScriptCore/jsc.cpp
- Timestamp:
- Sep 2, 2016, 5:12:16 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jsc.cpp
r205372 r205387 700 700 String m_profilerOutput; 701 701 String m_uncaughtExceptionName; 702 bool m_alwaysDumpUncaughtException { false }; 702 703 bool m_dumpSamplingProfilerData { false }; 703 704 … … 2109 2110 } 2110 2111 2111 static bool checkUncaughtException(VM& vm, GlobalObject* globalObject, JSValue exception, const String& expectedExceptionName )2112 static bool checkUncaughtException(VM& vm, GlobalObject* globalObject, JSValue exception, const String& expectedExceptionName, bool alwaysDumpException) 2112 2113 { 2113 2114 vm.clearException(); … … 2129 2130 return false; 2130 2131 } 2131 if (isInstanceOfExpectedException) 2132 if (isInstanceOfExpectedException) { 2133 if (alwaysDumpException) 2134 dumpException(globalObject, exception); 2132 2135 return true; 2136 } 2133 2137 2134 2138 printf("Expected uncaught exception with name '%s' but exception value is not instance of this exception class\n", expectedExceptionName.utf8().data()); … … 2137 2141 } 2138 2142 2139 static bool runWithScripts(GlobalObject* globalObject, const Vector<Script>& scripts, const String& uncaughtExceptionName, bool dump, bool module)2143 static bool runWithScripts(GlobalObject* globalObject, const Vector<Script>& scripts, const String& uncaughtExceptionName, bool alwaysDumpUncaughtException, bool dump, bool module) 2140 2144 { 2141 2145 String fileName; … … 2156 2160 dumpException(globalObject, value); 2157 2161 } else 2158 success = success && checkUncaughtException(vm, globalObject, (hasException) ? value : JSValue(), uncaughtExceptionName );2162 success = success && checkUncaughtException(vm, globalObject, (hasException) ? value : JSValue(), uncaughtExceptionName, alwaysDumpUncaughtException); 2159 2163 }; 2160 2164 … … 2300 2304 fprintf(stderr, " --module-file=<file> Parse and evaluate the given file as module (this option may be passed more than once)\n"); 2301 2305 fprintf(stderr, " --exception=<name> Check the last script exits with an uncaught exception with the specified name\n"); 2306 fprintf(stderr, " --dumpException Dump uncaught exception text\n"); 2302 2307 fprintf(stderr, " --options Dumps all JSC VM options and exits\n"); 2303 2308 fprintf(stderr, " --dumpOptions Dumps all non-default JSC VM options before continuing\n"); … … 2403 2408 } 2404 2409 2410 if (!strcmp(arg, "--dumpException")) { 2411 m_alwaysDumpUncaughtException = true; 2412 continue; 2413 } 2414 2405 2415 static const unsigned exceptionStrLength = strlen("--exception="); 2406 2416 if (!strncmp(arg, "--exception=", exceptionStrLength)) { … … 2453 2463 2454 2464 GlobalObject* globalObject = GlobalObject::create(*vm, GlobalObject::createStructure(*vm, jsNull()), options.m_arguments); 2455 bool success = runWithScripts(globalObject, options.m_scripts, options.m_uncaughtExceptionName, options.m_ dump, options.m_module);2465 bool success = runWithScripts(globalObject, options.m_scripts, options.m_uncaughtExceptionName, options.m_alwaysDumpUncaughtException, options.m_dump, options.m_module); 2456 2466 if (options.m_interactive && success) 2457 2467 runInteractive(globalObject);
Note:
See TracChangeset
for help on using the changeset viewer.