Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ function compilerArgsFromOptions(options, emitWarning) {
case "warn": return ["--warn"];
case "debug": return ["--debug"];
case "docs": return ["--docs", value]
case "runtimeOptions": return ["+RTS", value, "-RTS"]
default:
if (supportedOptions.indexOf(opt) === -1) {
emitWarning('Unknown Elm compiler option: ' + opt);
Expand All @@ -206,5 +207,6 @@ module.exports = {
compileWorker: require("./worker.js")(compile),
compileToString: compileToString,
compileToStringSync: compileToStringSync,
findAllDependencies: findAllDependencies
findAllDependencies: findAllDependencies,
_prepareProcessArgs: prepareProcessArgs
};
13 changes: 13 additions & 0 deletions test/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ describe("#compileToString", function() {
});
});

it("adds runtime options as arguments", function () {
var opts = {
yes: true,
verbose: true,
cwd: fixturesDir,
runtimeOptions: "-A128M -H128M -n8m"
};

return expect(compiler
._prepareProcessArgs("a.elm", opts)
.join(" ")).to.equal("a.elm --yes +RTS -A128M -H128M -n8m -RTS");
});

it("reports errors on bad syntax", function () {
var opts = {
yes: true,
Expand Down