mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix: Add missing Node.js natives to task runners (no-changelog) (#11362)
This commit is contained in:
@@ -153,6 +153,25 @@ export class JsTaskRunner extends TaskRunner {
|
||||
};
|
||||
}
|
||||
|
||||
private getNativeVariables() {
|
||||
return {
|
||||
// Exposed Node.js globals in vm2
|
||||
Buffer,
|
||||
Function,
|
||||
eval,
|
||||
setTimeout,
|
||||
setInterval,
|
||||
setImmediate,
|
||||
clearTimeout,
|
||||
clearInterval,
|
||||
clearImmediate,
|
||||
|
||||
// Missing JS natives
|
||||
btoa,
|
||||
atob,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes the requested code for all items in a single run
|
||||
*/
|
||||
@@ -170,19 +189,9 @@ export class JsTaskRunner extends TaskRunner {
|
||||
require: this.requireResolver,
|
||||
module: {},
|
||||
console: customConsole,
|
||||
|
||||
// Exposed Node.js globals in vm2
|
||||
Buffer,
|
||||
Function,
|
||||
eval,
|
||||
setTimeout,
|
||||
setInterval,
|
||||
setImmediate,
|
||||
clearTimeout,
|
||||
clearInterval,
|
||||
clearImmediate,
|
||||
|
||||
items: inputItems,
|
||||
|
||||
...this.getNativeVariables(),
|
||||
...dataProxy,
|
||||
...this.buildRpcCallObject(taskId),
|
||||
};
|
||||
@@ -232,6 +241,7 @@ export class JsTaskRunner extends TaskRunner {
|
||||
console: customConsole,
|
||||
item,
|
||||
|
||||
...this.getNativeVariables(),
|
||||
...dataProxy,
|
||||
...this.buildRpcCallObject(taskId),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user