mirror of
https://github.com/denoland/deno.git
synced 2024-12-02 17:01:14 -05:00
2c621f5894
This moves the op sanitizer descriptions into Rust code and prepares for eventual op import from `ext:core/ops`. We cannot import these ops from `ext:core/ops` as the testing infrastructure ops are not always present. Changes: - Op descriptions live in `cli` code and are currently accessible via an op for the older sanitizer code - `phf` dep moved to workspace root so we can use it here - `ops.op_XXX` changed to to `op_XXX` to prepare for op imports later on.
17 lines
476 B
TypeScript
17 lines
476 B
TypeScript
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
|
|
const EXPECTED_OP_COUNT = 158;
|
|
|
|
Deno.test(function checkExposedOps() {
|
|
// @ts-ignore TS doesn't allow to index with symbol
|
|
const core = Deno[Deno.internal].core;
|
|
const opNames = Object.keys(core.ops);
|
|
|
|
if (opNames.length !== EXPECTED_OP_COUNT) {
|
|
throw new Error(
|
|
`Expected ${EXPECTED_OP_COUNT} ops, but got ${opNames.length}:\n${
|
|
opNames.join("\n")
|
|
}`,
|
|
);
|
|
}
|
|
});
|