summaryrefslogtreecommitdiff
path: root/runtime/js/30_os.js
AgeCommit message (Collapse)Author
2024-06-02fix: validate integer values in `Deno.exitCode` setter (#24068)Kenta Moriuchi
2024-05-29feat: Add `Deno.exitCode` API (#23609)Luke Edwards
This commits adds the ability to set a would-be exit code for the Deno process without forcing an immediate exit, through the new `Deno.exitCode` API. - **Implements `Deno.exitCode` getter and setter**: Adds support for setting and retrieving a would-be exit code via `Deno.exitCode`. This allows for asynchronous cleanup before process termination without immediately exiting. - **Ensures type safety**: The setter for `Deno.exitCode` validates that the provided value is a number, throwing a TypeError if not, to ensure that only valid exit codes are set. Closes to #23605 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-26refactor: migrate extensions to virtual ops module (#22135)Bartek Iwańczuk
First pass of migrating away from `Deno.core.ensureFastOps()`. A few "tricky" ones have been left for a follow up.
2024-01-10refactor: use `core.ensureFastOps()` (#21888)Kenta Moriuchi
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-08chore: use primordials in 40_testing.js (#21422)Divy Srivastava
This commit brings back usage of primordials in "40_testing.js" by turning it back into an ES module and using new "lazy loading" functionality of ES modules coming from "deno_core". The same approach was applied to "40_jupyter.js". Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-12-07refactor: pull 'core', 'internals', 'primordials' from ES module (#21462)Bartek Iwańczuk
This commit refactors how we access "core", "internals" and "primordials" objects coming from `deno_core`, in our internal JavaScript code. Instead of capturing them from "globalThis.__bootstrap" namespace, we import them from recently added "ext:core/mod.js" file.
2023-11-10chore: use internal namespace in 40_testing.js (#21141)Divy Srivastava
Towards #21136 - [x] assign serializePermissions, setTimeout and setExitHandler APIs to internal namespace - [x] remove usage of assert
2023-05-01fix(core): Use primordials for methods (#18839)Kenta Moriuchi
I would like to get this change into Deno before merging https://github.com/denoland/deno_lint/pull/1152
2023-03-09fix(rumtime): Add `Deno.` prefix for registered symbols (#18086)Kenta Moriuchi
2023-03-08refactor: rename InternalModuleLoader to ExtModuleLoader, use ext: scheme ↵Bartek Iwańczuk
for snapshotted modules (#18041) This commit renames "deno_core::InternalModuleLoader" to "ExtModuleLoader" and changes the specifiers used by the modules loaded from this loader to "ext:". "internal:" scheme was really ambiguous and it's more characters than "ext:", which should result in slightly smaller snapshot size. Closes https://github.com/denoland/deno/issues/18020
2023-02-14feat: stabilize Deno.osUptime() (#17554)Bartek Iwańczuk
This commit stabilizes "Deno.osUptime()" API. The "--unstable" flag is no longer required to use this API.
2023-02-07 refactor: remove prefix from include_js_files & use extension name (#17683)Leo Kettmeir
2023-02-07refactor: Use ES modules for internal runtime code (#17648)Leo Kettmeir
This PR refactors all internal js files (except core) to be written as ES modules. `__bootstrap`has been mostly replaced with static imports in form in `internal:[path to file from repo root]`. To specify if files are ESM, an `esm` method has been added to `Extension`, similar to the `js` method. A new ModuleLoader called `InternalModuleLoader` has been added to enable the loading of internal specifiers, which is used in all situations except when a snapshot is only loaded, and not a new one is created from it. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-09feat(runtime/os): add `Deno.env.has()` (#17315)Leo Kettmeir
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-12-28fix(node): Add op_node_unstable_os_uptime to allow for node interop (#17208)Kamil Ogórek
2022-12-27feat(unstable): Add "Deno.osUptime()" API (#17179)Kamil Ogórek
This PR adds support for `Deno.osUptime` which reports number of seconds since os was booted. It will allow us to be compatible with Node's `os.uptime` - https://nodejs.org/api/os.html#osuptime Partially based on https://docs.rs/uptime_lib/latest/src/uptime_lib/lib.rs.html
2022-10-26chore(unstable): rename Deno.getUid() and Deno.getGid() (#16432)Colin Ihrig
This commit renames `Deno.getUid()` to `Deno.uid()` and renames `Deno.getGid()` to `Deno.gid()`.
2022-10-24experiment(ext/web): Don't expose event classes during the bootstrap phase ↵Andreu Botella
(#16213)
2022-08-11perf(ops): Monomorphic sync op calls (#15337)Aapo Alasuutari
Welcome to better optimised op calls! Currently opSync is called with parameters of every type and count. This most definitely makes the call megamorphic. Additionally, it seems that spread params leads to V8 not being able to optimise the calls quite as well (apparently Fast Calls cannot be used with spread params). Monomorphising op calls should lead to some improved performance. Now that unwrapping of sync ops results is done on Rust side, this is pretty simple: ``` opSync("op_foo", param1, param2); // -> turns to ops.op_foo(param1, param2); ``` This means sync op calls are now just directly calling the native binding function. When V8 Fast API Calls are enabled, this will enable those to be called on the optimised path. Monomorphising async ops likely requires using callbacks and is left as an exercise to the reader.
2022-05-31feat(unstable): add Deno.getGid (#14528)James Bradlee
2022-05-20fix: prevent Deno.exit to fail when dispatchEvent tampered (#14665)Yoshiya Hinosawa
Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
2022-01-31feat(unstable): add Deno.getUid (#13496)Yoshiya Hinosawa
2022-01-24feat(unstable): add Deno.networkInterfaces (#13475)Yoshiya Hinosawa
2022-01-07chore: update copyright to 2022 (#13306)Ryan Dahl
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
2021-11-28feat(runtime): add op_set_exit_code (#12911)Ben Noordhuis
Set the exit code to use if none is provided to Deno.exit(), or when Deno exits naturally. Needed for process.exitCode Node compat. Paves the way for #12888.
2021-10-05chore: various op cleanup (#12329)Leo K
2021-07-29feat(runtime): implement navigator.hardwareConcurrency (#11448)Divy Srivastava
This commit implements "navigator.hardwareConcurrency" API, which supersedes "Deno.systemCpuInfo()" API (which was removed in this commit).
2021-07-04refactor: use primordials in runtime/, part2 (#11248)Bartek Iwańczuk
2021-04-12refactor(deno): remove concept of bin & json ops (#10145)Aaron O'Mullan
2021-04-05refactor: convert ops to use serde_v8 (#10009)Aaron O'Mullan
This commit rewrites most of the ops to use "serde_v8" instead of "json" serialization.
2021-02-24feat: add exit sanitizer to Deno.test (#9529)Casper Beyer
This adds an exit sanitizer to ensure that code being tested or dependencies of that code can't accidentally call "Deno.exit" leading to partial test runs and false results.
2021-02-04chore: use strict mode for internal runtime, core, and op_crates js (#9391)Developing
2021-01-21fix(runtime): fix recursive dispatches of unload event (#9207)Yoshiya Hinosawa
2021-01-12fix(cli): dispatch unload on exit (#9088)Yoshiya Hinosawa
2021-01-11chore: update copyright to 2021 (#9092)Yusuke Tanaka
2020-12-17refactor: Rename runtime/rt to runtime/js (#8806)Nayeem Rahman