mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix: Extension being too eager and making calls when it shouldn't (#5232)
fix: extension being too eager and making calls when it shouldn't
This commit is contained in:
@@ -98,6 +98,16 @@ describe('tmpl Expression Parser', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edge cases', () => {
|
||||
test("Nested member access with name of function inside a function doesn't result in function call", () => {
|
||||
expect(evaluate('={{ Math.floor([1, 2, 3, 4].length + 10) }}')).toEqual(14);
|
||||
|
||||
expect(extendTransform('Math.floor([1, 2, 3, 4].length + 10)')?.code).toBe(
|
||||
'extend(Math, "floor", [[1, 2, 3, 4].length + 10])',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Non dot extensions', () => {
|
||||
test('min', () => {
|
||||
expect(evaluate('={{ min(1, 2, 3, 4, 5, 6) }}')).toEqual(1);
|
||||
|
||||
Reference in New Issue
Block a user