From 1635aab801152b8b36975dbc6cd02ea01ddbf778 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Sat, 11 Apr 2020 23:21:59 +0800 Subject: [PATCH] Fix exporting get/set timeout in web binding (#592) * Fix exporting get/set timeout in web binding Add two symbols "_ts_parser_set_timeout_micros", "_ts_parser_timeout_micros" due to usage in `tree-sitter.js`. * Fix getTimeoutMicros() not returning the value --- lib/binding_web/binding.js | 4 ++-- lib/binding_web/exports.json | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/binding_web/binding.js b/lib/binding_web/binding.js index 96f6ef08..f52f61d5 100644 --- a/lib/binding_web/binding.js +++ b/lib/binding_web/binding.js @@ -129,8 +129,8 @@ class Parser { C._ts_parser_set_timeout_micros(this[0], timeout); } - getTimeoutMicros(timeout) { - C._ts_parser_timeout_micros(this[0]); + getTimeoutMicros() { + return C._ts_parser_timeout_micros(this[0]); } setLogger(callback) { diff --git a/lib/binding_web/exports.json b/lib/binding_web/exports.json index 33fbad7a..2c638249 100644 --- a/lib/binding_web/exports.json +++ b/lib/binding_web/exports.json @@ -68,6 +68,8 @@ "_ts_parser_new_wasm", "_ts_parser_parse_wasm", "_ts_parser_set_language", + "_ts_parser_set_timeout_micros", + "_ts_parser_timeout_micros", "_ts_query_capture_count", "_ts_query_capture_name_for_id", "_ts_query_captures_wasm",