Skip to content

Commit

Permalink
Don't use ToJS on a RuleNode
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Apr 4, 2024
1 parent a001a46 commit 3da3eaa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
7 changes: 2 additions & 5 deletions crates/codegen/parser/runtime/src/napi_interface/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,8 @@ impl Cursor {
}

#[napi(ts_return_type = "Array<cst.RuleNode>", catch_unwind)]
pub fn ancestors(&self, env: Env) -> Vec<JsObject> {
self.0
.ancestors()
.map(|rust_rule_node| rust_rule_node.to_js(env))
.collect()
pub fn ancestors(&self) -> Vec<cst::RuleNode> {
self.0.ancestors().map(cst::RuleNode).collect()
}

#[napi(catch_unwind)]
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3da3eaa

Please sign in to comment.