Slide 25
Slide 25 text
type: Program
body:
- type: ExpressionStatement
expression:
type: CallExpression
callee:
type: MemberExpression
object:
type: Identifier
name: document
property:
type: Identifier
name: getElementById
arguments:
- type: Literal
value: id
Babel Plugin
#connect people to good stuff
Replace with document.getElementById
CallExpression(path, state) {
if (t.isIdentifier(path.node.callee, {name:
'$'})){
path.node.callee = t.memberExpression(
t.identifier('document'),
t.identifier('getElementById')
)
}
},