mirror of
https://github.com/esiur/esiur-js.git
synced 2026-04-04 14:08:20 +00:00
Static Calling
This commit is contained in:
@@ -46,18 +46,19 @@ export default class FunctionTemplate extends MemberTemplate {
|
||||
bl
|
||||
.addInt32(exp.length)
|
||||
.addDC(exp);
|
||||
bl.insertUint8(0, this.inherited ? 0x90 : 0x10);
|
||||
bl.insertUint8(0, (this.inherited ? 0x90 : 0x10) | (this.isStatic ? 0x4 : 0));
|
||||
} else
|
||||
bl.insertUint8(0, this.inherited ? 0x80 : 0x0);
|
||||
bl.insertUint8(0, (this.inherited ? 0x80 : 0x0) | (this.isStatic ? 0x4 : 0));
|
||||
|
||||
return bl.toDC();
|
||||
}
|
||||
|
||||
constructor(template, index, name, inherited, args, returnType, annotation = null){
|
||||
constructor(template, index, name, inherited, isStatic, args, returnType, annotation = null){
|
||||
super(template, index, name, inherited);
|
||||
|
||||
this.args = args;
|
||||
this.returnType = returnType;
|
||||
this.annotation = annotation;
|
||||
this.isStatic = isStatic;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,6 +452,7 @@ export default class TypeTemplate {
|
||||
if (type == 0) // function
|
||||
{
|
||||
let annotation = null;
|
||||
let isStatic = ((data[offset] & 0x4) == 0x4);
|
||||
let hasAnnotation = ((data.getUint8(offset++) & 0x10) == 0x10);
|
||||
|
||||
let len = data.getUint8(offset++);
|
||||
@@ -484,7 +485,7 @@ export default class TypeTemplate {
|
||||
offset += cs;
|
||||
}
|
||||
|
||||
let ft = new FunctionTemplate(od, functionIndex++, name, inherited,
|
||||
let ft = new FunctionTemplate(od, functionIndex++, name, inherited, isStatic,
|
||||
args, dt.type, annotation);
|
||||
|
||||
od.functions.push(ft);
|
||||
|
||||
Reference in New Issue
Block a user