Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Switch to safe-eval #774

Closed
wants to merge 1 commit into from
Closed

Switch to safe-eval #774

wants to merge 1 commit into from

Conversation

stathismor
Copy link
Contributor

static-eval has two issues:

  1. It needs an unnecessary object check when writing a callback parameter. I have raised an issue about it at the repo.
  2. It does not support arrow functions.

safe-eval solves both of these issues. It works a bit differently, it takes the string expression rather than an ast expression. I still kept the esprima, estree packages, as they are useful for identifying the semantics of the expression (what type it is, arguments, etc) which the existing code needs.

Change-type: minor
Signed-off-by: Stathis Moraitidis stathis@balena.io

@stathismor
Copy link
Contributor Author

@balena-ci rebase

@ghost ghost force-pushed the switch-to-safe-eval branch from 9e46012 to 396e322 Compare January 21, 2022 10:19
@LucianBuzzo
Copy link
Contributor

@stathismor This looks fairly sane to me, though I think it would be worth testing the beta package on a draft PR in the jellyfish-worker module to make sure it doesn't break something that we happen to not be testing on this package 😬

static-eval needs an unnecessary object check when writing a callback parameter. It also does not support arrow functions. safe-eval solves both of these issues.

Change-type: minor
Signed-off-by: Stathis Moraitidis <stathis@balena.io>
@LucianBuzzo
Copy link
Contributor

Testing upstream here product-os/jellyfish-worker#1418

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants