1
0
mirror of https://github.com/fluencelabs/assemblyscript synced 2025-06-20 02:11:31 +00:00

Initial external decorator for annotating explicit import names; Use file name as default module name in imports; Emit empty memory if there are no static segments; Update TLSF and examples accordingly

This commit is contained in:
dcodeIO
2018-06-28 01:44:32 +02:00
parent 27e61f8f67
commit 9c16363796
110 changed files with 17069 additions and 16757 deletions
cli
dist
examples
lib/parse
package.json
src
std
assembly.d.ts
assembly
allocator
tests
allocators
compiler.js
compiler
binary.optimized.watbinary.untouched.watbuiltins.tsclass-extends.optimized.watclass-extends.untouched.watclass-overloading.optimized.watclass-overloading.untouched.watclass-with-boolean-field.optimized.watclass-with-boolean-field.untouched.watclosure.optimized.watclosure.untouched.watdeclare.optimized.watdeclare.untouched.watempty.optimized.watempty.untouched.watenum.optimized.watenum.untouched.watexport.optimized.watexport.untouched.watexports.optimized.watexports.untouched.watexternal.optimized.watexternal.tsexternal.untouched.watfunction.optimized.watfunction.untouched.wati64-polyfill.optimized.wati64-polyfill.untouched.watimport.optimized.watimport.untouched.watlimits.optimized.watlimits.untouched.watliterals.optimized.watliterals.untouched.watmain.optimized.watmain.untouched.watmandelbrot.optimized.watmandelbrot.untouched.watnamed-export-default.optimized.watnamed-export-default.untouched.watnamed-import-default.optimized.watnamed-import-default.untouched.watnamespace.optimized.watnamespace.untouched.watportable-conversions.optimized.watportable-conversions.untouched.watrecursive.optimized.watrecursive.untouched.watreexport.optimized.watreexport.untouched.watscoped.optimized.watscoped.untouched.wat
std
ternary.optimized.watternary.untouched.wattypealias.optimized.wattypealias.untouched.watunary.optimized.watunary.untouched.watvoid.optimized.watvoid.untouched.wat
parser

@ -65,8 +65,12 @@ export function parse(binary: Uint8Array, options?: ParseOptions): void {
parse.readString = (offset: number, length: number): string => utf8_read(buffer, offset, offset + length);
// instantiate the parser and return its exports
function nop(): void {}
var imports = { env: { memory } };
var imports = {
env: {
memory
},
options: {}
};
[ "onSection",
"onType",
"onTypeParam",
@ -85,7 +89,7 @@ export function parse(binary: Uint8Array, options?: ParseOptions): void {
"onModuleName",
"onFunctionName",
"onLocalName"
].forEach((name: string): void => imports.env[name] = options[name] || nop);
].forEach((name: string): void => imports.options[name] = options[name] || function() {});
var instance = new WebAssembly.Instance(compiled, imports);
instance.exports.parse(0, nBytes);
}