Skip to content

remove eval() - #646

Open
k-yle wants to merge 1 commit into
mapillary:mainfrom
k-yle:kh/eval
Open

k-yle wants to merge 1 commit into
mapillary:mainfrom
k-yle:kh/eval

Conversation

@k-yle

@k-yle k-yle commented Oct 19, 2026

Copy link
Copy Markdown

Motivation

eval (or new Function) is considered dangerous and discouraged, even if this paticular usage is safe.

By using eval, this library prevents consumers from enabling stricter security settings like a Content Security Policy or Trusted Types.

Have you read the Contributing Guidelines?

yes

Contribution

Replaced eval/new Function with procedural code.

Instead of constructing the filter using code like return "!(" + expression + ")";, we now use actual JS code like return (x) => !f(x);

Test Plan

all the existing unit tests for FilterCreator.test.ts still pass

@meta-cla meta-cla Bot added the cla signed label Oct 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant