fix: setnode method for rehydration code

This commit is contained in:
Jonathan Kelley committed 2022-03-17 10:51:23 -04:00
1 parent 014eb974f7
commit f26f704b6b
6 files changed
+61 -30

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ extern "C" {
pub fn new(arg: Element) -> Interpreter;
#[wasm_bindgen(method)]
pub fn set_node(this: &Interpreter, id: usize, node: Node);
pub fn SetNode(this: &Interpreter, id: usize, node: Node);
#[wasm_bindgen(method)]
pub fn PushRoot(this: &Interpreter, root: u64);
+3
View File
@@ -20,6 +20,9 @@ export class Interpreter {
pop() {
return this.stack.pop();
}
SetNode(id, node) {
this.nodes[id] = node;
}
PushRoot(root) {
const node = this.nodes[root];
this.stack.push(node);