mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-09 21:11:27 +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
|
// 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) imports.env = {};
|
||||||
if (!imports.env.abort) imports.env.abort = function abort(mesg, file, line, colm) {
|
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) {
|
function getString(memory, ptr) {
|
||||||
if (!memory) return "<yet unknown>";
|
if (!memory) return "<yet unknown>";
|
||||||
var buffer = memory.buffer;
|
var buffer = memory.buffer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user