Skip to content
change the this of code
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Readme.md
index.js
package.json

Readme.md

ast-replace-this

Replaces the this variable with the given expression. Consumes/produces Mozilla ASTs.

API

replaceThis(Node, replacement, recurse = false) -> Node

Returns a new AST with all ThisExpressions replaced with the given expression. If recurse is truthy, it will recurse to cover every scope in the AST.

Something went wrong with that request. Please try again.