The most basic components of a modern jsc command line interface consist of the following: - A simple REPL to enter commands and receive results - The ability to define a module (which consists of various internal methods as well as a set of externally visible methods) - The ability to load other modules at runtime - The ability to interact with the underlying platform to perform various "privileged" functions (e.g. opening files, printing to the stdout, etc.) The basic architecture will look something like the following: - If the tool is run in REPL mode (i.e. no command line arguments), it will start the REPL on the main thread and start a secondary thread with a run loop to handle various inputs from the REPL thread. - If the tool is given a script to run, it will evaluate that script (and any scripts that it might transitively load) within the run loop on the main thread.
Created attachment 221896 [details] Patch
Comment on attachment 221896 [details] Patch the existing jsc prompt supports multiline input which this does not appear to :(
(In reply to comment #2) > (From update of attachment 221896 [details]) > the existing jsc prompt supports multiline input which this does not appear to :( I'll file a bug for it. This will probably never replace the old jsc since other platforms can't compile Objective-C.
(In reply to comment #3) > (In reply to comment #2) > > (From update of attachment 221896 [details] [details]) > > the existing jsc prompt supports multiline input which this does not appear to :( > > I'll file a bug for it. This will probably never replace the old jsc since other platforms can't compile Objective-C. I sort of skipped a sentence there. I meant to also say that this will probably not replace jsc on our own platforms for some time until the new jsc-cli reaches feature parity with the old jsc. In addition, the old jsc will probably stick around indefinitely anyways due to the absence of Objective-C on other platforms.
Comment on attachment 221896 [details] Patch rs=me
(In reply to comment #2) > (From update of attachment 221896 [details]) > the existing jsc prompt supports multiline input which this does not appear to :( I filed bug 127484 to track this.
Comment on attachment 221896 [details] Patch Clearing flags on attachment: 221896 Committed r162612: <http://trac.webkit.org/changeset/162612>
All reviewed patches have been landed. Closing bug.
Re-opened since this is blocked by bug 127488
Had to roll it back out because I forgot that EWS doesn't test changes to the Tools directory, and thus this patch broke several platforms.
Committed r163991: <http://trac.webkit.org/changeset/163991>