(script: Option<&Script>)
| 29 | } |
| 30 | |
| 31 | fn gen_script_source_header(script: Option<&Script>) -> String { |
| 32 | match script { |
| 33 | None => { |
| 34 | r#"import {Script} from "/script"; const script = new Script("unknown.ts", 0, null);"# |
| 35 | .to_string() |
| 36 | } |
| 37 | Some(s) => { |
| 38 | format!( |
| 39 | r#"import {{Script}} from "/script";const script = new Script("{}.ts", {}, {});"#, |
| 40 | s.name, |
| 41 | s.id, |
| 42 | s.plugin_id |
| 43 | .map(|v| format!("'{v}'")) |
| 44 | .unwrap_or("null".to_string()), |
| 45 | ) |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | pub fn init_v8_flags(v8_flags: &[String]) { |
| 51 | let v8_flags_includes_help = v8_flags |
no outgoing calls
no test coverage detected