Skip to content

Commit

Permalink
Merge pull request #432 from moonbitlang/v8_stack_size_flag
Browse files Browse the repository at this point in the history
feat: support --stack-size flag for v8
  • Loading branch information
Young-Flash authored Oct 30, 2024
2 parents bfe8e6a + fae0320 commit 79c4de0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/moonrun/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use std::any::Any;
use std::io::{self, Write};
use std::path::Path;
use std::{cell::Cell, io::Read, path::PathBuf, time::Instant};
use v8::V8::set_flags_from_string;

mod fs_api_temp;
mod js;
Expand Down Expand Up @@ -503,6 +504,9 @@ struct Commandline {

#[clap(long)]
test_mode: bool,

#[clap(long)]
stack_size: Option<String>,
}

fn main() -> anyhow::Result<()> {
Expand All @@ -519,6 +523,10 @@ fn main() -> anyhow::Result<()> {
anyhow::bail!("no such file");
}

if let Some(stack_size) = matches.stack_size {
set_flags_from_string(&format!("--stack-size={}", stack_size));
}

match file.extension().unwrap().to_str() {
Some("wasm") => wasm_mode(
file,
Expand Down

0 comments on commit 79c4de0

Please sign in to comment.