fix(core): VM2 sandbox should not throw on new Promise (#10298)
This commit is contained in:
committed by
GitHub
parent
f6fc287cc7
commit
7e95f9e2e4
@@ -153,7 +153,7 @@
|
||||
"@langchain/textsplitters": "0.0.3",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
"@n8n/typeorm": "0.3.20-10",
|
||||
"@n8n/vm2": "3.9.24",
|
||||
"@n8n/vm2": "3.9.25",
|
||||
"@pinecone-database/pinecone": "3.0.0",
|
||||
"@qdrant/js-client-rest": "1.9.0",
|
||||
"@supabase/supabase-js": "2.43.4",
|
||||
|
||||
@@ -59,6 +59,34 @@
|
||||
"type": "n8n-nodes-base.code",
|
||||
"typeVersion": 1,
|
||||
"position": [460, 860]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"mode": "runOnceForEachItem",
|
||||
"jsCode": "const json = $input.item.json\njson.myNewField = await (async () => json.value)();\n\nreturn $input.item;"
|
||||
},
|
||||
"id": "3cff4a64-c3fd-47d3-a33e-3c446846138f",
|
||||
"name": "With Async Functions",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
460,
|
||||
1200
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"mode": "runOnceForEachItem",
|
||||
"jsCode": "const json = $input.item.json\njson.myNewField = await new Promise((resolve) => resolve(json.value));\n\nreturn $input.item;"
|
||||
},
|
||||
"id": "947e4e3e-2da3-40c5-97da-830c4572fc05",
|
||||
"name": "With Promises",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
460,
|
||||
1380
|
||||
]
|
||||
}
|
||||
],
|
||||
"pinData": {
|
||||
@@ -103,6 +131,34 @@
|
||||
"myNewField": 2
|
||||
}
|
||||
}
|
||||
],
|
||||
"With Async Functions": [
|
||||
{
|
||||
"json": {
|
||||
"value": 1,
|
||||
"myNewField": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"value": 2,
|
||||
"myNewField": 2
|
||||
}
|
||||
}
|
||||
],
|
||||
"With Promises": [
|
||||
{
|
||||
"json": {
|
||||
"value": 1,
|
||||
"myNewField": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"value": 2,
|
||||
"myNewField": 2
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"connections": {
|
||||
@@ -139,6 +195,16 @@
|
||||
"node": "Run Once for Each Item (Legacy Syntax)",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "With Async Functions",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "With Promises",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -830,7 +830,7 @@
|
||||
"dependencies": {
|
||||
"@kafkajs/confluent-schema-registry": "1.0.6",
|
||||
"@n8n/imap": "workspace:*",
|
||||
"@n8n/vm2": "3.9.24",
|
||||
"@n8n/vm2": "3.9.25",
|
||||
"amqplib": "0.10.3",
|
||||
"alasql": "^4.4.0",
|
||||
"aws4": "1.11.0",
|
||||
|
||||
Reference in New Issue
Block a user