add strict option to bable-plugin-transform-strict-mode

This commit is contained in:
Sebastian McKenzie
2015-11-05 11:04:14 +00:00
parent 35b5ff103c
commit 5802e2e334

View File

@@ -3,9 +3,11 @@ import * as t from "babel-types";
export default function () {
return {
visitor: {
Program(path) {
let { node } = path;
Program(path, state) {
if (state.opts.strict === false) return;
let { node } = path;
for (let directive of (node.directives: Array<Object>)) {
if (directive.value.value === "use strict") return;
}