summaryrefslogtreecommitdiff
path: root/src/flags.rs
diff options
context:
space:
mode:
authorztplz <mysticzt@gmail.com>2018-10-01 22:23:36 +0800
committerRyan Dahl <ry@tinyclouds.org>2018-10-01 10:23:36 -0400
commit1fcc11a19d4522851870eec79ca17233a353cb9e (patch)
treebec44c4d6e5b3135c69125637d7eb71d370a9f2a /src/flags.rs
parentbcdbfc00f01a94fed1d3f1d11f8aacc627c5ca36 (diff)
rename parse_core_args to v8_set_flags_preprocess (#871)
Diffstat (limited to 'src/flags.rs')
-rw-r--r--src/flags.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/flags.rs b/src/flags.rs
index 9828ef9cb..d8815ef1f 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<String>) -> (Vec<String>, Vec<String>) {
+fn v8_set_flags_preprocess(args: Vec<String>) -> (Vec<String>, Vec<String>) {
let mut rest = vec![];
// Filter out args that shouldn't be passed to V8
@@ -193,9 +192,9 @@ fn parse_core_args(args: Vec<String>) -> (Vec<String>, Vec<String>) {
}
#[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<String>) -> Vec<String> {
// 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())