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);
});