constant-folding-module-adrian-fleitas-de-la-rosa-alu0101024363

Functions

replaceCall(n)

Replace the call expression with a Literal

replaceLength(n)

Replace the length call with a Literal

replaceByLiteral(n)

Replace the content of the node left, right to literals

replaceIndex(n)

Replace the [][] call with a Literal

constantFolding(code)string

A function that constant fold the a javascript file

replaceCall(n)

Replace the call expression with a Literal

Kind: global function

Param Type Description
n Node the node to evaluate and modify

replaceLength(n)

Replace the length call with a Literal

Kind: global function

Param Type Description
n Node the node to evaluate and modify

replaceByLiteral(n)

Replace the content of the node left, right to literals

Kind: global function

Param Type Description
n Node the node to evaluate and modify

replaceIndex(n)

Replace the [][] call with a Literal

Kind: global function

Param Type Description
n Node the node to evaluate and modify

constantFolding(code) ⇒ string

A function that constant fold the a javascript file

Kind: global function
Returns: string - the result javascript code

Param Type Description
code string A string that contains javascript code