-
Notifications
You must be signed in to change notification settings - Fork 142
Open
Description
Sometimes a .wrapped wrapper requires access to context data, e.g. in order to decrypt a payload, one would need the decryption key. Thus the wrapper function should be able to access this (as it's current context) similar to how e.g. formatters are able to access the current context.
I am not deeply familiar with the code generation part, however as far as I can judge, the "this" refrence in the generateWrapper code:
ctx.pushCode(
`${wrappedBuf} = ${func}.call(this, ${wrappedBuf}).subarray(0);`,
);Doesn't make any sense, as this is the global scope and should be changed to:
ctx.pushCode(
`${wrappedBuf} = ${func}.call(${ctx.generateVariable()}, ${wrappedBuf}).subarray(0);`,
);As for other calls to imports.
Metadata
Metadata
Assignees
Labels
No labels