summary refs log tree commit diff stats
path: root/compiler/nimrod.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/nimrod.nim')
-rwxr-xr-xcompiler/nimrod.nim9
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/nimrod.nim b/compiler/nimrod.nim
index 6328c3ae3..1bd6698a7 100755
--- a/compiler/nimrod.nim
+++ b/compiler/nimrod.nim
@@ -98,9 +98,14 @@ proc HandleCmdLine() =
                    formatFloat(epochTime() - start, ffDecimal, 3),
                    formatSize(getTotalMem())])
       if optRun in gGlobalOptions:
-        var ex = quoteIfContainsWhite(
+        if gCmd == cmdCompileToEcmaScript:
+          var ex = quoteIfContainsWhite(
+            completeCFilePath(changeFileExt(gProjectFull, "js").prependCurDir))
+          execExternalProgram("node " & ex & ' ' & arguments)
+        else:
+          var ex = quoteIfContainsWhite(
             changeFileExt(gProjectFull, exeExt).prependCurDir)
-        execExternalProgram(ex & ' ' & arguments)
+          execExternalProgram(ex & ' ' & arguments)
 
 #GC_disableMarkAndSweep()