mirror of
https://github.com/swc-project/swc.git
synced 2024-12-22 13:11:31 +03:00
947161b43b
swc_bundler: - Fix deglobbing of imports. (denoland/deno#8985) - Use correct syntax context while deglobbing imports. (denoland/deno#9212) - Allow reexporting from wrapped esms. (denoland/deno#8959, denoland/deno#9200) - Fix statement orderings. (denoland/deno#9250) - Emit injected items as early as possible. (denoland/deno#9250) - Respect `external_modules`. (#1338) - Fix cjs suppport. (#1328) swc_ecma_transforms_base: - hygiene: Fix for hoisting. (denoland/deno#9212)
12 lines
324 B
TypeScript
12 lines
324 B
TypeScript
const heap = new Array(32).fill(undefined);
|
|
heap.push(undefined, null, true, false);
|
|
let heap_next = heap.length;
|
|
function addHeapObject(obj) {
|
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
const idx = heap_next;
|
|
heap_next = heap[idx];
|
|
heap[idx] = obj;
|
|
return idx;
|
|
}
|
|
addHeapObject("hello");
|