class properties with an undefined value are now correctly writable

This commit is contained in:
Jay Phelps
2015-04-13 20:46:33 -07:00
parent 64f5480f96
commit 6ca565d7fb
6 changed files with 45 additions and 0 deletions

View File

@@ -552,6 +552,11 @@ class ClassTransformer {
this.instancePropBody.push(t.expressionStatement(
t.assignmentExpression("=", t.memberExpression(t.thisExpression(), node.key), node.value)
));
node.value = null;
}
if (!node.value) {
node.value = t.identifier("undefined");
}