Add offsetof<T> builtin; Put a function's trampoline into the function table if a it has optional parameters; TypedArray scaffolding

This commit is contained in:
dcodeIO
2018-03-24 00:38:49 +01:00
parent ec5bb7ad51
commit 664f2a1c0d
17 changed files with 1301 additions and 612 deletions

View File

@ -1192,6 +1192,10 @@ export class Compiler extends DiagnosticEmitter {
}
var functionTable = this.functionTable;
var index = functionTable.length;
if (func.signature.requiredParameters < func.signature.parameterTypes.length) {
// insert the trampoline if the function has optional parameters
func = this.ensureTrampoline(func);
}
functionTable.push(func);
func.functionTableIndex = index;
return index;