Fix wasm tests on CI (#616)
* wasm: Improve error message on missing language symbol * Fix source file existence checks in build-wasm command
This commit is contained in:
parent
2934e219cf
commit
40993195b8
2 changed files with 8 additions and 4 deletions
|
|
@ -872,10 +872,14 @@ class Language {
|
|||
return bytes
|
||||
.then(bytes => loadWebAssemblyModule(bytes, {loadAsync: true}))
|
||||
.then(mod => {
|
||||
const functionName = Object.keys(mod).find(key =>
|
||||
const symbolNames = Object.keys(mod)
|
||||
const functionName = symbolNames.find(key =>
|
||||
LANGUAGE_FUNCTION_REGEX.test(key) &&
|
||||
!key.includes("external_scanner_")
|
||||
);
|
||||
if (!functionName) {
|
||||
console.log(`Couldn't find language function in WASM file. Symbols:\n${JSON.stringify(symbolNames, null, 2)}`)
|
||||
}
|
||||
const languageAddress = mod[functionName]();
|
||||
return new Language(INTERNAL, languageAddress);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue