Changeset 43960 in webkit
- Timestamp:
- May 20, 2009 10:52:44 PM (15 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r43951 r43960 1 2009-05-20 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Cameron Zwarich. 4 5 Cleanup the JSGlobalData when exiting early with the usage statement in jsc. 6 7 * jsc.cpp: 8 (printUsageStatement): 9 (parseArguments): 10 (jscmain): 11 1 12 2009-05-20 Stephanie Lewis <slewis@apple.com> 2 13 -
trunk/JavaScriptCore/jsc.cpp
r43619 r43960 464 464 } 465 465 466 static NO_RETURN void printUsageStatement( bool help = false)466 static NO_RETURN void printUsageStatement(JSGlobalData* globalData, bool help = false) 467 467 { 468 468 fprintf(stderr, "Usage: jsc [options] [files] [-- arguments]\n"); … … 473 473 fprintf(stderr, " -i Enables interactive mode (default if no files are specified)\n"); 474 474 fprintf(stderr, " -s Installs signal handlers that exit on a crash (Unix platforms only)\n"); 475 476 cleanupGlobalData(globalData); 475 477 exit(help ? EXIT_SUCCESS : EXIT_FAILURE); 476 478 } 477 479 478 static void parseArguments(int argc, char** argv, Options& options )480 static void parseArguments(int argc, char** argv, Options& options, JSGlobalData* globalData) 479 481 { 480 482 int i = 1; … … 483 485 if (strcmp(arg, "-f") == 0) { 484 486 if (++i == argc) 485 printUsageStatement( );487 printUsageStatement(globalData); 486 488 options.scripts.append(Script(true, argv[i])); 487 489 continue; … … 489 491 if (strcmp(arg, "-e") == 0) { 490 492 if (++i == argc) 491 printUsageStatement( );493 printUsageStatement(globalData); 492 494 options.scripts.append(Script(false, argv[i])); 493 495 continue; 494 496 } 495 497 if (strcmp(arg, "-h") == 0 || strcmp(arg, "--help") == 0) { 496 printUsageStatement( true);498 printUsageStatement(globalData, true); 497 499 } 498 500 if (strcmp(arg, "-i") == 0) { … … 532 534 533 535 Options options; 534 parseArguments(argc, argv, options );536 parseArguments(argc, argv, options, globalData); 535 537 536 538 GlobalObject* globalObject = new (globalData) GlobalObject(options.arguments);
Note: See TracChangeset
for help on using the changeset viewer.