add strict mode plugin to module transforms

This commit is contained in:
Sebastian McKenzie
2015-10-30 04:38:46 +00:00
parent 268a1f80a0
commit 79f39c3be1
4 changed files with 10 additions and 4 deletions

View File

@@ -8,9 +8,10 @@
"dependencies": {
"babel-types": "^6.0.2",
"babel-runtime": "^6.0.2",
"babel-template": "^6.0.2"
"babel-template": "^6.0.2",
"babel-plugin-transform-strict-mode": "^6.0.2"
},
"keywords": [
"babel-plugin"
]
}
}

View File

@@ -118,6 +118,8 @@ export default function () {
};
return {
inherits: require("babel-plugin-transform-strict-mode"),
visitor: {
ThisExpression(path) {
if (!path.findParent((path) => !path.is("shadow") && THIS_BREAK_KEYS.indexOf(path.type) >= 0)) {

View File

@@ -8,9 +8,10 @@
"dependencies": {
"babel-template": "^6.0.2",
"babel-helper-hoist-variables": "^6.0.2",
"babel-runtime": "^6.0.2"
"babel-runtime": "^6.0.2",
"babel-plugin-transform-strict-mode": "^6.0.2"
},
"keywords": [
"babel-plugin"
]
}
}

View File

@@ -49,6 +49,8 @@ export default function ({ types: t }) {
};
return {
inherits: require("babel-plugin-transform-strict-mode"),
visitor: {
Program: {
exit(path) {