Last active
February 10, 2016 15:55
-
-
Save schmod/f8bd79277e4ce556fef9 to your computer and use it in GitHub Desktop.
Babel Block Scoping Transform -- Scope Bindings are not renamed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"plugins": ["babel-plugin-transform-es2015-block-scoping", "./plugin"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "babel-let", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"babel-core": "^6.5.1", | |
"babel-plugin-transform-es2015-block-scoping": "^6.5.0" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function () { | |
const callVisitor = function(path){ | |
path.node.arguments.forEach(arg => { | |
console.log("Name: " + arg.name + ". Bindings in scope: " + Object.keys(path.scope.bindings)); | |
}); | |
}; | |
return { | |
visitor: { | |
CallExpression: callVisitor | |
} | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
function myFn1(a, b) { | |
} | |
if (true) { | |
let myFn1 = function(c) { | |
}; | |
doSomething(myFn1); | |
} | |
doSomething(myFn1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
babel src.js