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:
cli
dist
examples
game-of-life
mandelbrot
pson
lib/parse
package.jsonsrc
std
tests
allocators
compiler.jscompiler
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
constructor.optimized.watconstructor.untouched.wathash.optimized.wathash.tshash.untouched.watlibm.optimized.watlibm.untouched.watmath.optimized.watmath.tsmath.untouched.watnew.optimized.watnew.untouched.wat
ternary.optimized.watternary.untouched.wattypealias.optimized.wattypealias.untouched.watunary.optimized.watunary.untouched.watvoid.optimized.watvoid.untouched.watparser
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user