Bug 715498 - Revive the -c "compile only" option for the JS shell. r=cdleary
authorBlake Kaplan <mrbkap@gmail.com>
Fri, 23 Dec 2011 18:25:16 +0100
changeset 85164 347c13fd3e43e9a5d84f3703fe735e8335410a46
parent 85163 8522883040c0afc619cd05161d9b36c439136cb2
child 85165 461a7c9235945abb04cb87e5b1aa8697a7745246
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscdleary
bugs715498
milestone12.0a1
Bug 715498 - Revive the -c "compile only" option for the JS shell. r=cdleary
js/src/shell/js.cpp
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -5059,16 +5059,19 @@ BindScriptArgs(JSContext *cx, JSObject *
 static int
 ProcessArgs(JSContext *cx, JSObject *obj, OptionParser *op)
 {
     RootObject root(cx, &obj);
 
     if (op->getBoolOption('a'))
         JS_ToggleOptions(cx, JSOPTION_METHODJIT_ALWAYS);
 
+    if (op->getBoolOption('c'))
+        compileOnly = true;
+
     if (op->getBoolOption('m')) {
         enableMethodJit = true;
         JS_ToggleOptions(cx, JSOPTION_METHODJIT);
     }
 
 #ifdef JS_GC_ZEAL
     if (const char *zeal = op->getStringOption('Z'))
         ParseZealArg(cx, zeal);
@@ -5326,16 +5329,17 @@ main(int argc, char **argv, char **envp)
     op.setHelpWidth(80);
     op.setVersion(JS_GetImplementationVersion());
 
     if (!op.addMultiStringOption('f', "file", "PATH", "File path to run")
         || !op.addMultiStringOption('e', "execute", "CODE", "Inline code to run")
         || !op.addBoolOption('i', "shell", "Enter prompt after running code")
         || !op.addBoolOption('m', "methodjit", "Enable the JaegerMonkey method JIT")
         || !op.addBoolOption('n', "typeinfer", "Enable type inference")
+        || !op.addBoolOption('c', "compileonly", "Only compile, don't run (syntax checking mode)")
         || !op.addBoolOption('d', "debugjit", "Enable runtime debug mode for method JIT code")
         || !op.addBoolOption('a', "always-mjit",
                              "Do not try to run in the interpreter before method jitting.")
         || !op.addBoolOption('D', "dump-bytecode", "Dump bytecode with exec count for all scripts")
         || !op.addBoolOption('b', "print-timing", "Print sub-ms runtime for each file that's run")
 #ifdef DEBUG
         || !op.addIntOption('A', "oom-after", "COUNT", "Trigger OOM after COUNT allocations", -1)
         || !op.addBoolOption('O', "print-alloc", "Print the number of allocations at exit")