fix: compile fail for web
This commit is contained in:
1 parent
93405c2a40
commit
dfc69c0905
3 files changed
+7
No files matched your search
@@ -17,6 +17,9 @@ extern "C" {
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn PushRoot(this: &Interpreter, root: u64);
|
||||
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn PopRoot(this: &Interpreter);
|
||||
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn AppendChildren(this: &Interpreter, many: u32);
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ export class Interpreter {
|
||||
const node = this.nodes[root];
|
||||
this.stack.push(node);
|
||||
}
|
||||
PopRoot() {
|
||||
this.stack.pop();
|
||||
}
|
||||
AppendChildren(many) {
|
||||
let root = this.stack[this.stack.length - (1 + many)];
|
||||
let to_add = this.stack.splice(this.stack.length - many);
|
||||
|
||||
@@ -105,6 +105,7 @@ impl WebsysDom {
|
||||
for edit in edits.drain(..) {
|
||||
match edit {
|
||||
DomEdit::PushRoot { root } => self.interpreter.PushRoot(root),
|
||||
DomEdit::PopRoot {} => self.interpreter.PopRoot(),
|
||||
DomEdit::AppendChildren { many } => self.interpreter.AppendChildren(many),
|
||||
DomEdit::ReplaceWith { root, m } => self.interpreter.ReplaceWith(root, m),
|
||||
DomEdit::InsertAfter { root, n } => self.interpreter.InsertAfter(root, n),
|
||||
|
||||
Reference in new issue
Block a user