refactor(wasm)!: make current*, is*, and has* methods properties

This commit is contained in:
Boris Verkhovskiy 2024-02-28 07:33:56 -08:00 committed by Amaan Qureshi
parent 4b578a3649
commit c070c92722
6 changed files with 54 additions and 54 deletions

View file

@ -249,27 +249,27 @@ class Node {
return C._ts_node_next_parse_state_wasm(this.tree[0]);
}
isNamed() {
get isNamed() {
marshalNode(this);
return C._ts_node_is_named_wasm(this.tree[0]) === 1;
}
hasError() {
get hasError() {
marshalNode(this);
return C._ts_node_has_error_wasm(this.tree[0]) === 1;
}
hasChanges() {
get hasChanges() {
marshalNode(this);
return C._ts_node_has_changes_wasm(this.tree[0]) === 1;
}
isError() {
get isError() {
marshalNode(this);
return C._ts_node_is_error_wasm(this.tree[0]) === 1;
}
isMissing() {
get isMissing() {
marshalNode(this);
return C._ts_node_is_missing_wasm(this.tree[0]) === 1;
}
@ -608,19 +608,19 @@ class TreeCursor {
return C._ts_tree_cursor_end_index_wasm(this.tree[0]);
}
currentNode() {
get currentNode() {
marshalTreeCursor(this);
C._ts_tree_cursor_current_node_wasm(this.tree[0]);
return unmarshalNode(this.tree);
}
currentFieldId() {
get currentFieldId() {
marshalTreeCursor(this);
return C._ts_tree_cursor_current_field_id_wasm(this.tree[0]);
}
currentFieldName() {
return this.tree.language.fields[this.currentFieldId()];
get currentFieldName() {
return this.tree.language.fields[this.currentFieldId];
}
gotoFirstChild() {