diff --git a/nix-js/src/runtime.rs b/nix-js/src/runtime.rs index 53c605d..eae924f 100644 --- a/nix-js/src/runtime.rs +++ b/nix-js/src/runtime.rs @@ -715,6 +715,8 @@ impl Runtime { // Initialize V8 once static INIT: Once = Once::new(); INIT.call_once(|| { + // First flag is always not recognized + assert_eq!(deno_core::v8_set_flags(vec!["".into(), format!("--stack-size={}", 8 * 1024)]), [""]); JsRuntime::init_platform( Some(v8::new_default_platform(0, false).make_shared()), false, diff --git a/nix-js/tests/regex.rs b/nix-js/tests/regex.rs index 0de6cd0..33d1b8b 100644 --- a/nix-js/tests/regex.rs +++ b/nix-js/tests/regex.rs @@ -3,6 +3,8 @@ mod utils; use nix_js::value::{List, Value}; use utils::eval; +use crate::utils::eval_result; + #[test] fn match_exact_full_string() { assert_eq!( @@ -253,8 +255,7 @@ fn replace_longer_pattern() { #[test] fn replace_different_lengths() { - let result = - std::panic::catch_unwind(|| eval(r#"builtins.replaceStrings ["a" "b"] ["x"] "test""#)); + let result = eval_result(r#"builtins.replaceStrings ["a" "b"] ["x"] "test""#); assert!(result.is_err()); }