From a872466c8ed936e2ad68a8a2ba717a7bda8689bf Mon Sep 17 00:00:00 2001 From: stephan Date: Wed, 16 Nov 2022 21:52:29 +0000 Subject: Change a self.X JS reference to X to account for a symbol resolution discrepancy between vanilla JS and ES6 modules, as explained in [forum:801d8f77e5115141|forum post 801d8f77e5115141]. FossilOrigin-Name: 0590de4da1103d842b9f9f25bcd2e69223b2ea067ae2f320f58dd3763218b39d --- ext/wasm/api/extern-post-js.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ext/wasm/api/extern-post-js.js') diff --git a/ext/wasm/api/extern-post-js.js b/ext/wasm/api/extern-post-js.js index 84b99b53a..d933a3626 100644 --- a/ext/wasm/api/extern-post-js.js +++ b/ext/wasm/api/extern-post-js.js @@ -15,7 +15,10 @@ impls which Emscripten installs at some point in the file above this. */ - const originalInit = self.sqlite3InitModule; + const originalInit = + /*Maintenance reminde: DO NOT use `self.` here. It's correct + for non-ES6 Module cases but wrong for ES6 modules because those + resolve this symbol differently! */ sqlite3InitModule; if(!originalInit){ throw new Error("Expecting self.sqlite3InitModule to be defined by the Emscripten build."); } -- cgit v1.2.3