refactor: use core.ensureFastOps() (#21888)

This commit is contained in:
Kenta Moriuchi 2024-01-11 07:37:25 +09:00 committed by GitHub
parent d4893eb51a
commit 515a34b4de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
107 changed files with 1653 additions and 1147 deletions

View file

@ -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: {