mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-19 18:01:31 +00:00
expose runtime id of exported class
This commit is contained in:
@ -605,10 +605,19 @@ export class Compiler extends DiagnosticEmitter {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ElementKind.CLASS: {
|
||||
// make the class name itself represent its runtime id
|
||||
if (!(<Class>element).type.isUnmanaged) {
|
||||
let module = this.module;
|
||||
let internalName = (<Class>element).internalName;
|
||||
module.addGlobal(internalName, NativeType.I32, false, module.createI32((<Class>element).ensureId()));
|
||||
module.addGlobalExport(internalName, prefix + name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// just traverse members below
|
||||
case ElementKind.ENUM:
|
||||
case ElementKind.CLASS:
|
||||
case ElementKind.NAMESPACE:
|
||||
case ElementKind.FILE:
|
||||
case ElementKind.TYPEDEFINITION: break;
|
||||
|
Reference in New Issue
Block a user