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

Method emit_leb_u

test/fixtures/wpt/wasm/jsapi/wasm-module-builder.js:708–720  ·  view source on GitHub ↗
(val, max_len)

Source from the content-addressed store, hash-verified

706 }
707
708 emit_leb_u(val, max_len) {
709 this.ensure_space(max_len);
710 for (let i = 0; i < max_len; ++i) {
711 let v = val & 0xff;
712 val = val >>> 7;
713 if (val == 0) {
714 this.buffer[this.length++] = v;
715 return;
716 }
717 this.buffer[this.length++] = v | 0x80;
718 }
719 throw new Error("Leb value exceeds maximum length of " + max_len);
720 }
721
722 emit_u32v(val) {
723 this.emit_leb_u(val, kMaxVarInt32Size);

Callers 2

emit_u32vMethod · 0.95
emit_u64vMethod · 0.95

Calls 1

ensure_spaceMethod · 0.95

Tested by

no test coverage detected