Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --executable raw to pass just [] #259

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 2 additions & 3 deletions src/jsx-command.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class JSXCommand {
"Options:\n" +
" --add-search-path path adds a path to library search paths\n" +
" --executable RUNENV adds launcher to call _Main.main(:string[]):void\n" +
" supported RUNENV is node, commonjs and web.\n" +
" RUNENV is raw, node, commonjs, and web.\n" +
" --run runs _Main.main(:string[]):void after compiling\n" +
" --test runs _Test#test*():void after compiling\n" +
" --output file output file (default:stdout)\n" +
Expand Down Expand Up @@ -263,10 +263,9 @@ class JSXCommand {
return 1;
}
switch (optarg) {
case "raw": // implies JavaScriptEmitter
case "web": // implies JavaScriptEmitter
break;
case "commonjs": // implies JavaScriptEmitter
break;
case "node": // implies JavaScriptEmitter
break;
default:
Expand Down
4 changes: 3 additions & 1 deletion t/006.jsx.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use strict;
use warnings;
use tool::Util;
use Test::More tests => 106;
use Test::More tests => 112;

note "testing jsx(1)";

Expand Down Expand Up @@ -65,6 +65,8 @@ foreach my $jsx(qw(bin/jsx bin/jsx-with-server)) {
jsx_ok("--run t/006.jsx/dump-args.jsx 'foo bar'", qq{["foo bar"]\n});
jsx_ok("--run t/006.jsx/dump-args.jsx '/@~_+&=;'", qq{["/@~_+&=;"]\n});

jsx_ok("--executable raw --run t/006.jsx/dump-args.jsx foo bar", qq{[]\n});

# real command

is scalar(`$jsx --run --input-filename t/006.jsx/hello.jsx -- - < t/006.jsx/hello.jsx`), "Hello, world!\n", "jsx --run -- - (input from stdin)";
Expand Down