mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 10:33:54 +00:00
refactor: use core.ensureFastOps()
(#21888)
This commit is contained in:
parent
d4893eb51a
commit
515a34b4de
107 changed files with 1653 additions and 1147 deletions
|
@ -1,7 +1,11 @@
|
|||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
import { core, primordials } from "ext:core/mod.js";
|
||||
const ops = core.ops;
|
||||
const {
|
||||
op_bootstrap_language,
|
||||
op_bootstrap_numcpus,
|
||||
op_bootstrap_user_agent,
|
||||
} = core.ensureFastOps(true);
|
||||
const {
|
||||
ObjectDefineProperties,
|
||||
ObjectPrototypeIsPrototypeOf,
|
||||
|
@ -51,9 +55,9 @@ function memoizeLazy(f) {
|
|||
};
|
||||
}
|
||||
|
||||
const numCpus = memoizeLazy(() => ops.op_bootstrap_numcpus());
|
||||
const userAgent = memoizeLazy(() => ops.op_bootstrap_user_agent());
|
||||
const language = memoizeLazy(() => ops.op_bootstrap_language());
|
||||
const numCpus = memoizeLazy(() => op_bootstrap_numcpus());
|
||||
const userAgent = memoizeLazy(() => op_bootstrap_user_agent());
|
||||
const language = memoizeLazy(() => op_bootstrap_language());
|
||||
|
||||
ObjectDefineProperties(Navigator.prototype, {
|
||||
gpu: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue