Skip to content

Commit

Permalink
Update loader, see #188, see #200
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Aug 2, 2018
1 parent 404a688 commit 8ae12aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/loader/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export declare function instantiate<T extends {}>(module: WebAssembly.Module, im
/** Instantiates an AssemblyScript module from a buffer using the specified imports. */
export declare function instantiateBuffer<T extends {}>(buffer: Uint8Array, imports?: ImportsObject): ASUtil & T;

/** Instantiates an AssemblyScript module from a response using the sspecified imports. */
export declare function instantiateStreaming<T extends {}>(response: Response, imports?: ImportsObject): Promise<ASUtil & T>;
/** Instantiates an AssemblyScript module from a response using the specified imports. */
export declare function instantiateStreaming<T extends {}>(result: Promise<Response>, imports?: ImportsObject): Promise<ASUtil & T>;

/** Demangles an AssemblyScript module's exports to a friendly object structure. */
export declare function demangle<T extends {}>(exports: {}): T;
2 changes: 1 addition & 1 deletion lib/loader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function instantiate(module, imports) {
/** Allocates a new string in the module's memory and returns its pointer. */
function newString(str) {
var dataLength = str.length;
var ptr = exports.allocate_memory(4 + (dataLength << 1));
var ptr = exports["memory.allocate"](4 + (dataLength << 1));
var dataOffset = (4 + ptr) >>> 1;
checkMem();
U32[ptr >>> 2] = dataLength;
Expand Down

0 comments on commit 8ae12aa

Please sign in to comment.