Always evaluate an expression for JS
People were complaining too much
This commit is contained in:
parent
7c5203bc1d
commit
cf1589eb2f
3 changed files with 3 additions and 15 deletions
|
@ -79,7 +79,6 @@ Options are optionally set in `options`, which is a semicolon-delimited list of
|
||||||
- `java` Java (OpenJDK)
|
- `java` Java (OpenJDK)
|
||||||
- `js` JavaScript (Node)
|
- `js` JavaScript (Node)
|
||||||
- `harmony` enables harmony features (`--harmony` on node)
|
- `harmony` enables harmony features (`--harmony` on node)
|
||||||
- `e` prints the result of evaluating the code
|
|
||||||
- `julia` Julia
|
- `julia` Julia
|
||||||
- `e` prints the result of evaluating the code
|
- `e` prints the result of evaluating the code
|
||||||
- `lisp` Racket
|
- `lisp` Racket
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
if [ "$EVAL_EXPR" = "true" ]; then
|
|
||||||
flag="-p"
|
|
||||||
else
|
|
||||||
flag="-e"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$EVAL_HARMONY" = "true" ]; then
|
if [ "$EVAL_HARMONY" = "true" ]; then
|
||||||
node --harmony "$flag" "$1"
|
node --harmony -p "$1"
|
||||||
else
|
else
|
||||||
node "$flag" "$1"
|
node -p "$1"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -6,8 +6,7 @@ class JavaScript extends Language {
|
||||||
name: 'JavaScript',
|
name: 'JavaScript',
|
||||||
aliases: ['javascript', 'js'],
|
aliases: ['javascript', 'js'],
|
||||||
options: {
|
options: {
|
||||||
harmony: () => '',
|
harmony: () => ''
|
||||||
e: () => ''
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -18,10 +17,6 @@ class JavaScript extends Language {
|
||||||
ret.env.EVAL_HARMONY = 'true';
|
ret.env.EVAL_HARMONY = 'true';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.has('e')) {
|
|
||||||
ret.env.EVAL_EXPR = 'true';
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue