Changeset 30795 in webkit for trunk/JavaScriptCore/API/minidom.c


Ignore:
Timestamp:
Mar 5, 2008, 10:19:12 AM (17 years ago)
Author:
[email protected]
Message:

Allow override of default script file name using command-line argument.

Reviewed by Adele.

  • API/minidom.c: (main): Allow first command-line argument to override the default script file name of "minidom.js".
  • API/testapi.c: (main): Allow first command-line argument to override the default script file name of "testapi.js".
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/minidom.c

    r29672 r30795  
    4040int main(int argc, char* argv[])
    4141{
    42     UNUSED_PARAM(argc);
    43     UNUSED_PARAM(argv);
     42    const char *scriptPath = "minidom.js";
     43    if (argc > 1) {
     44        scriptPath = argv[1];
     45    }
    4446   
    4547    JSGlobalContextRef context = JSGlobalContextCreate(NULL);
     
    5456    JSStringRelease(node);
    5557   
    56     char* scriptUTF8 = createStringWithContentsOfFile("minidom.js");
     58    char* scriptUTF8 = createStringWithContentsOfFile(scriptPath);
    5759    JSStringRef script = JSStringCreateWithUTF8CString(scriptUTF8);
    5860    JSValueRef exception;
Note: See TracChangeset for help on using the changeset viewer.