From 224e79ca27a2d1d7c0ea4b312ba850ea69e37c40 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 22 Nov 2021 15:56:26 -0800 Subject: [PATCH] web: Fix script directory that's passed to locateFile --- lib/binding_web/prefix.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/binding_web/prefix.js b/lib/binding_web/prefix.js index 382035e1..c6bc7c22 100644 --- a/lib/binding_web/prefix.js +++ b/lib/binding_web/prefix.js @@ -1,5 +1,9 @@ var TreeSitter = function() { var initPromise; + var document = typeof window == 'object' + ? {currentScript: window.document.currentScript} + : null; + class Parser { constructor() { this.initialize(); @@ -11,5 +15,5 @@ var TreeSitter = function() { static init(moduleOptions) { if (initPromise) return initPromise; - Module = Object.assign({ }, Module, moduleOptions); + Module = Object.assign({}, Module, moduleOptions); return initPromise = new Promise((resolveInitPromise) => {