Tweak wasm binding to work with new upstream LLVM backend

This commit is contained in:
Max Brunsfeld 2019-10-21 16:10:29 -07:00
parent 49c632ae90
commit 7ccec8c0e2
2 changed files with 4 additions and 3 deletions

View file

@ -874,7 +874,10 @@ class Language {
return bytes
.then(bytes => loadWebAssemblyModule(bytes, {loadAsync: true}))
.then(mod => {
const functionName = Object.keys(mod).find(key => key.includes("tree_sitter_"));
const functionName = Object.keys(mod).find(key =>
key.includes("tree_sitter_") &&
!key.includes("external_scanner_")
);
const languageAddress = mod[functionName]();
return new Language(INTERNAL, languageAddress);
});

View file

@ -62,14 +62,12 @@ done
emcc=
if which emcc > /dev/null && [[ "$force_docker" == "0" ]]; then
export EMCC_FORCE_STDLIBS=libc++
emcc=emcc
elif which docker > /dev/null; then
emcc="docker run \
--rm \
-v $(pwd):/src:Z \
-u $(id -u) \
-e EMCC_FORCE_STDLIBS=libc++ \
trzeci/emscripten-slim \
emcc"
else