ccxvii / mujs

An embeddable Javascript interpreter in C.
http://mujs.com/
ISC License
812 stars 98 forks source link

[improvement suggestion] Please make JS_ENVLIMIT a build parameter #94

Closed yurivict closed 4 years ago

yurivict commented 5 years ago

With JS_ENVLIMIT=64, a recursive function with 1 argument can call itself ~61 times, and a function with 6 arguements can call itself ~27 times.

It is easy to exceed these limitations in a real-world code.

I suggest that you add a build-time parameter, ex. envlimit=1024 would change this value to 1024.

ccxvii commented 5 years ago

Are you confusing JS_ENVLIMIT with JS_STACKSIZE?

yurivict commented 5 years ago

Are you confusing JS_ENVLIMIT with JS_STACKSIZE?

Possibly. I'm not quite sure what's the difference. Maybe both should be made build-time configurable.

ccxvii commented 4 years ago

All limits are now configurable at build time by setting preprocessor defines.