refactor(core): Remove legacy expression evaluator (#14518)

This commit is contained in:
Iván Ovejero
2025-05-13 17:29:48 +02:00
committed by GitHub
parent 694af6c9f0
commit 131baabb7f
22 changed files with 221 additions and 423 deletions

View File

@@ -1,3 +1,4 @@
import { ApplicationError } from '@/errors';
import { objectExtensions } from '@/Extensions/ObjectExtensions';
import { evaluate } from './Helpers';
@@ -126,7 +127,9 @@ describe('Data Transformation Functions', () => {
test('should not allow prototype pollution', () => {
['{__proto__: {polluted: true}}', '{constructor: {prototype: {polluted: true}}}'].forEach(
(testExpression) => {
expect(evaluate(`={{ (${testExpression}).compact() }}`)).toEqual(null);
expect(() => evaluate(`={{ (${testExpression}).compact() }}`)).toThrow(
ApplicationError,
);
expect(({} as any).polluted).toBeUndefined();
},
);