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

[Merged by Bors] - Add --strict flag to cli #2689

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ Arguments:
The JavaScript file(s) to be evaluated

Options:
--strict
Run in strict mode

-a, --dump-ast [<FORMAT>]
Dump the AST to stdout with the given format

Expand Down
7 changes: 7 additions & 0 deletions boa_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ struct Opt {
#[arg(name = "FILE", value_hint = ValueHint::FilePath)]
files: Vec<PathBuf>,

/// Run in strict mode.
#[arg(long)]
strict: bool,

/// Dump the AST to stdout with the given format.
#[arg(
long,
Expand Down Expand Up @@ -256,6 +260,9 @@ fn main() -> Result<(), io::Error> {
.build()
.expect("cannot fail with default global object");

// Strict mode
context.strict(args.strict);

// Trace Output
context.set_trace(args.trace);

Expand Down