This repository has been archived by the owner on Mar 31, 2019. It is now read-only.
Cache getter property values on BScript class #41
Labels
optimization
Related to making the library more performant
This prevents having to perform the calculation multiple times. This requires the use of
Object.defineProperty
.This requires that a script's tokens are immutable. Consider enforcing this by freezing (a copy of the) the token array and making the Token class's instance properties read-only (unfortunately, there is not a neat syntax for this built into the language).
The text was updated successfully, but these errors were encountered: