mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-09 13:01:26 +00:00
Fix fallback to imported memory in loader, fixes #322
This commit is contained in:
parent
c6447e3c3b
commit
b924c152c5
@ -26,7 +26,7 @@ function preInstantiate(imports) {
|
||||
// add the internal abort function that is called when an assertion fails or an error is thrown
|
||||
if (!imports.env) imports.env = {};
|
||||
if (!imports.env.abort) imports.env.abort = function abort(mesg, file, line, colm) {
|
||||
var memory = baseModule.memory || this.memory; // prefer exported, otherwise try imported
|
||||
var memory = baseModule.memory || imports.env.memory; // prefer exported, otherwise try imported
|
||||
function getString(memory, ptr) {
|
||||
if (!memory) return "<yet unknown>";
|
||||
var buffer = memory.buffer;
|
||||
|
Loading…
x
Reference in New Issue
Block a user