TotalTechGeek / json-logic-engine

Construct complex rules with JSON & process them.
MIT License
46 stars 9 forks source link

[Bug] Yield is a reserved word #5

Closed enchorb closed 1 year ago

enchorb commented 1 year ago

The use of the class Yield causes an error when building in some instances where strict mode is enabled. (https://stackoverflow.com/questions/33316765/why-is-es6-yield-a-reserved-word-when-called-in-this-context)

or instance, my react native apps keeps failing to build because of it:

error ./node_modules/json-logic-engine/dist/cjs/index.js: Yield cannot be used as identifier inside generators in file ./node_modules/json-logic-engine/dist/cjs/index.js at 683:16.
Error: Yield cannot be used as identifier inside generators in file ./node_modules/json-logic-engine/dist/cjs/index.js at 683:16
    at minifyCode (/node_modules/metro-transform-worker/src/index.js:100:13)
    at transformJS (/node_modules/metro-transform-worker/src/index.js:321:28)
    at transformJSWithBabel (/node_modules/metro-transform-worker/src/index.js:412:16)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.transform (/node_modules/metro-transform-worker/src/index.js:573:12)
TotalTechGeek commented 1 year ago

Odd. I understand why "yield" would be considered reserved, but not "Yield".

Keywords are meant to be case sensitive, so it seems like an overzealous transpiler. I don't consider this to be a bug within my code, but I will rename it to mitigate the issue.

TotalTechGeek commented 1 year ago

This should be resolved in the v1.2.0 release.