summaryrefslogtreecommitdiff
path: root/runtime/ops
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/ops')
-rw-r--r--runtime/ops/bootstrap.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/runtime/ops/bootstrap.rs b/runtime/ops/bootstrap.rs
index 1d4039d73..7de532a9f 100644
--- a/runtime/ops/bootstrap.rs
+++ b/runtime/ops/bootstrap.rs
@@ -17,6 +17,7 @@ deno_core::extension!(
op_bootstrap_log_level,
op_bootstrap_no_color,
op_bootstrap_is_tty,
+ op_bootstrap_unstable_args,
op_snapshot_options,
],
options = {
@@ -70,6 +71,23 @@ pub fn op_bootstrap_user_agent(state: &mut OpState) -> String {
}
#[op2]
+#[serde]
+pub fn op_bootstrap_unstable_args(state: &mut OpState) -> Vec<String> {
+ let options = state.borrow::<BootstrapOptions>();
+ if options.unstable {
+ return vec!["--unstable".to_string()];
+ }
+
+ let mut flags = Vec::new();
+ for (name, _, id) in crate::UNSTABLE_GRANULAR_FLAGS.iter() {
+ if options.unstable_features.contains(id) {
+ flags.push(format!("--unstable-{}", name));
+ }
+ }
+ flags
+}
+
+#[op2]
#[string]
pub fn op_bootstrap_language(state: &mut OpState) -> String {
state.borrow::<BootstrapOptions>().locale.clone()