Skip to content

v1.2.0

Compare
Choose a tag to compare
@mysticatea mysticatea released this 08 May 13:45
· 58 commits to master since this release
v1.2.0
6965b2e

It added new getStaticValue function 🎉

The getStaticValue evaluates AST node statically then get the static value.
For a complex example, this function can evaluate the following case on AST:

const eventName = "click"
const aMap = Object.freeze({
    click: 777
})

;`on${eventName} : ${aMap[eventName]}` // evaluated to "onclick : 777"

Enhancements

  • 904e48f added the 2nd parameter to getPropertyName function.
  • 32fd9fa added the new getStaticValue function.