summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
authorLeo Kettmeir <crowlkats@toaxl.com>2023-02-08 22:40:18 +0100
committerGitHub <noreply@github.com>2023-02-08 22:40:18 +0100
commit286e5d0be9bb11a69d55f0eedd4a6678b0d48e7d (patch)
tree37399e924de155fbcbeab975222bdb16f257e228 /runtime/js
parentbef50416b92a3ed7bf44b361fc5360f9a52c83e6 (diff)
refactor: internal runtime code TS support (#17672)
This is a proof of concept for being able to snapshot TypeScript files. Currently only a single runtime file is authored in TypeScript - "runtime/js/01_version.ts". Not needed infrastructure was removed from "core/snapshot_util.rs". --------- Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/01_version.ts (renamed from runtime/js/01_version.js)8
-rw-r--r--runtime/js/90_deno_ns.js2
-rw-r--r--runtime/js/99_main.js2
3 files changed, 9 insertions, 3 deletions
diff --git a/runtime/js/01_version.js b/runtime/js/01_version.ts
index 62f3df17c..cbbbd8d03 100644
--- a/runtime/js/01_version.js
+++ b/runtime/js/01_version.ts
@@ -3,7 +3,13 @@
const primordials = globalThis.__bootstrap.primordials;
const { ObjectFreeze } = primordials;
-const version = {
+interface Version {
+ deno: string;
+ v8: string;
+ typescript: string;
+}
+
+const version: Version = {
deno: "",
v8: "",
typescript: "",
diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js
index 5321bf1d3..fe59ea1a7 100644
--- a/runtime/js/90_deno_ns.js
+++ b/runtime/js/90_deno_ns.js
@@ -12,7 +12,7 @@ import * as http from "internal:deno_http/01_http.js";
import * as flash from "internal:deno_flash/01_http.js";
import * as build from "internal:runtime/js/01_build.js";
import * as errors from "internal:runtime/js/01_errors.js";
-import * as version from "internal:runtime/js/01_version.js";
+import * as version from "internal:runtime/js/01_version.ts";
import * as permissions from "internal:runtime/js/10_permissions.js";
import * as io from "internal:runtime/js/12_io.js";
import * as buffer from "internal:runtime/js/13_buffer.js";
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index 5d9012bc4..fd7b93e24 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -43,7 +43,7 @@ import * as util from "internal:runtime/js/06_util.js";
import * as event from "internal:deno_web/02_event.js";
import * as location from "internal:deno_web/12_location.js";
import * as build from "internal:runtime/js/01_build.js";
-import * as version from "internal:runtime/js/01_version.js";
+import * as version from "internal:runtime/js/01_version.ts";
import * as os from "internal:runtime/js/30_os.js";
import * as timers from "internal:deno_web/02_timers.js";
import * as colors from "internal:deno_console/01_colors.js";