summaryrefslogtreecommitdiff
path: root/cli/main.rs
diff options
context:
space:
mode:
authorBartek Iwańczuk <biwanczuk@gmail.com>2024-01-15 01:26:57 +0100
committerGitHub <noreply@github.com>2024-01-15 01:26:57 +0100
commit5143b9e7d3f72e6cc23f8381295df17ff1235f53 (patch)
tree6c8a59aa1fd0feb23601e009bde04c03c66e6593 /cli/main.rs
parentf46c03d6b4a59f5f1771cb3fbec15fe034b81dde (diff)
feat(unstable): add Temporal API support (#21738)
This commit adds support for [Stage 3 Temporal API proposal](https://tc39.es/proposal-temporal/docs/). The API is available when `--unstable-temporal` flag is passed. --------- Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: David Sherret <dsherret@gmail.com> Co-authored-by: Kenta Moriuchi <moriken@kimamass.com>
Diffstat (limited to 'cli/main.rs')
-rw-r--r--cli/main.rs24
1 files changed, 19 insertions, 5 deletions
diff --git a/cli/main.rs b/cli/main.rs
index 6a9ac3327..53c7bdf5a 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -316,21 +316,27 @@ pub(crate) static UNSTABLE_GRANULAR_FLAGS: &[(
7,
),
(
+ "temporal",
+ "Enable unstable Temporal API",
+ // Not used in JS
+ 8,
+ ),
+ (
"unsafe-proto",
"Enable unsafe __proto__ support. This is a security risk.",
// This number is used directly in the JS code. Search
- // for "unstableFeatures" to see where it's used.
- 8,
+ // for "unstableIds" to see where it's used.
+ 9,
),
(
deno_runtime::deno_webgpu::UNSTABLE_FEATURE_NAME,
"Enable unstable `WebGPU` API",
- 9,
+ 10,
),
(
deno_runtime::ops::worker_host::UNSTABLE_FEATURE_NAME,
"Enable unstable Web Worker APIs",
- 10,
+ 11,
),
];
@@ -394,7 +400,15 @@ pub fn main() {
// Using same default as VSCode:
// https://github.com/microsoft/vscode/blob/48d4ba271686e8072fc6674137415bc80d936bc7/extensions/typescript-language-features/src/configuration/configuration.ts#L213-L214
DenoSubcommand::Lsp => vec!["--max-old-space-size=3072".to_string()],
- _ => vec![],
+ _ => {
+ if flags.unstable
+ || flags.unstable_features.contains(&"temporal".to_string())
+ {
+ vec!["--harmony-temporal".to_string()]
+ } else {
+ vec![]
+ }
+ }
};
init_v8_flags(&default_v8_flags, &flags.v8_flags, get_v8_flags_from_env());
deno_core::JsRuntime::init_platform(None);