babel-plugin-transform-safely
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -28,8 +28,4 @@ module.exports = function ({ types: t }) { | ||
path.replaceWith(t.logicalExpression('||', node, t.assignmentExpression('=', node, isArray ? t.arrayExpression([]) : t.objectExpression([])))) | ||
return path.node | ||
} else if (t.isMemberExpression(node)) { | ||
let ensuredObject = ensureObject(path.get('object'), t.isNumericLiteral(node.property)) | ||
if (!ensuredObject) { | ||
// var _gen1 = expr; | ||
} | ||
let objectRef = getObjectReference(path.get('object')) | ||
@@ -39,6 +35,5 @@ path.replaceWith(t.logicalExpression('||', | ||
markAsSafe(t.assignmentExpression('=', markAsSafe(t.memberExpression(objectRef, node.property, node.computed)), isArray ? t.arrayExpression([]) : t.objectExpression([]))))) | ||
return path.node | ||
} | ||
// else can't be ensured | ||
// else can't be ensured, just used the referenced expression | ||
return path.node | ||
} | ||
@@ -45,0 +40,0 @@ |
@@ -21,3 +21,2 @@ { | ||
"name": "babel-plugin-transform-safely", | ||
"readme": "ERROR: No README data found!", | ||
"repository": { | ||
@@ -28,3 +27,3 @@ "type": "git", | ||
"scripts": {}, | ||
"version": "0.1.1" | ||
"version": "0.1.2" | ||
} |
@@ -37,2 +37,5 @@ var obj = {foo: 'bar'} | ||
} | ||
}, | ||
thisAssignment: function() { | ||
safely(this.obj['a'] ='b') | ||
} | ||
@@ -39,0 +42,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9386
180