diff --git a/README.md b/README.md index 3ae24be2a0..b5230b8d46 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,9 @@ Arguments: The JavaScript file(s) to be evaluated Options: + --strict + Run in strict mode + -a, --dump-ast [] Dump the AST to stdout with the given format diff --git a/boa_cli/src/main.rs b/boa_cli/src/main.rs index b36c6d28c0..98d759f0d8 100644 --- a/boa_cli/src/main.rs +++ b/boa_cli/src/main.rs @@ -94,6 +94,10 @@ struct Opt { #[arg(name = "FILE", value_hint = ValueHint::FilePath)] files: Vec, + /// Run in strict mode. + #[arg(long)] + strict: bool, + /// Dump the AST to stdout with the given format. #[arg( long, @@ -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);