MCPcopy Create free account
hub / github.com/nodejs/node / defineWasmOpcode

Function defineWasmOpcode

deps/v8/test/mjsunit/wasm/wasm-module-builder.js:518–528  ·  view source on GitHub ↗
(name, value)

Source from the content-addressed store, hash-verified

516};
517
518function defineWasmOpcode(name, value) {
519 if (globalThis.kWasmOpcodeNames === undefined) {
520 globalThis.kWasmOpcodeNames = {};
521 }
522 Object.defineProperty(globalThis, name, {value: value});
523 if (globalThis.kWasmOpcodeNames[value] !== undefined) {
524 throw new Error(`Duplicate wasm opcode: ${value}. Previous name: ${
525 globalThis.kWasmOpcodeNames[value]}, new name: ${name}`);
526 }
527 globalThis.kWasmOpcodeNames[value] = name;
528}
529for (let name in kWasmOpcodes) {
530 defineWasmOpcode(`kExpr${name}`, kWasmOpcodes[name]);
531}

Callers 1

Calls 1

definePropertyMethod · 0.45

Tested by

no test coverage detected