mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
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>
This commit is contained in:
parent
bef50416b9
commit
286e5d0be9
14 changed files with 261 additions and 113 deletions
30
runtime/js/01_version.ts
Normal file
30
runtime/js/01_version.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
const primordials = globalThis.__bootstrap.primordials;
|
||||
const { ObjectFreeze } = primordials;
|
||||
|
||||
interface Version {
|
||||
deno: string;
|
||||
v8: string;
|
||||
typescript: string;
|
||||
}
|
||||
|
||||
const version: Version = {
|
||||
deno: "",
|
||||
v8: "",
|
||||
typescript: "",
|
||||
};
|
||||
|
||||
function setVersions(
|
||||
denoVersion,
|
||||
v8Version,
|
||||
tsVersion,
|
||||
) {
|
||||
version.deno = denoVersion;
|
||||
version.v8 = v8Version;
|
||||
version.typescript = tsVersion;
|
||||
|
||||
ObjectFreeze(version);
|
||||
}
|
||||
|
||||
export { setVersions, version };
|
Loading…
Add table
Add a link
Reference in a new issue