From 1fcc11a19d4522851870eec79ca17233a353cb9e Mon Sep 17 00:00:00 2001 From: ztplz Date: Mon, 1 Oct 2018 22:23:36 +0800 Subject: [PATCH] rename parse_core_args to v8_set_flags_preprocess (#871) --- src/flags.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/flags.rs b/src/flags.rs index 9828ef9cb9..d8815ef1f9 100644 --- a/src/flags.rs +++ b/src/flags.rs @@ -166,8 +166,7 @@ fn test_set_flags_4() { } // Returns args passed to V8, followed by args passed to JS -// TODO Rename to v8_set_flags_preprocess -fn parse_core_args(args: Vec) -> (Vec, Vec) { +fn v8_set_flags_preprocess(args: Vec) -> (Vec, Vec) { let mut rest = vec![]; // Filter out args that shouldn't be passed to V8 @@ -193,9 +192,9 @@ fn parse_core_args(args: Vec) -> (Vec, Vec) { } #[test] -fn test_parse_core_args_1() { +fn test_v8_set_flags_preprocess_1() { let js_args = - parse_core_args(vec!["deno".to_string(), "--v8-options".to_string()]); + v8_set_flags_preprocess(vec!["deno".to_string(), "--v8-options".to_string()]); assert_eq!( js_args, (vec!["deno".to_string(), "--help".to_string()], vec![]) @@ -203,8 +202,8 @@ fn test_parse_core_args_1() { } #[test] -fn test_parse_core_args_2() { - let js_args = parse_core_args(vec!["deno".to_string(), "--help".to_string()]); +fn test_v8_set_flags_preprocess_2() { + let js_args = v8_set_flags_preprocess(vec!["deno".to_string(), "--help".to_string()]); assert_eq!( js_args, (vec!["deno".to_string()], vec!["--help".to_string()]) @@ -217,7 +216,7 @@ pub fn v8_set_flags(args: Vec) -> Vec { // deno_set_v8_flags(int* argc, char** argv) mutates argc and argv to remove // flags that v8 understands. // First parse core args, then converto to a vector of C strings. - let (argv, rest) = parse_core_args(args); + let (argv, rest) = v8_set_flags_preprocess(args); let mut argv = argv .iter() .map(|arg| CString::new(arg.as_str()).unwrap().into_bytes_with_nul())