Merge branch 'master' into code-generator
Conflicts: lib/6to5/transformers/classes.js test/fixtures/transformation/source-maps/class/expected.js test/fixtures/transformation/source-maps/class/source-mappings.json
This commit is contained in:
@@ -107,16 +107,28 @@ var buildClassBody = function (file, construct, body, className, superName, node
|
||||
}, true));
|
||||
}
|
||||
|
||||
var instanceProps;
|
||||
var staticProps;
|
||||
|
||||
if (!_.isEmpty(instanceMutatorMap)) {
|
||||
var protoId = util.template("prototype-identifier", {
|
||||
CLASS_NAME: className
|
||||
});
|
||||
|
||||
body.push(util.buildDefineProperties(instanceMutatorMap, protoId));
|
||||
instanceProps = util.buildDefineProperties(instanceMutatorMap, protoId);
|
||||
}
|
||||
|
||||
if (!_.isEmpty(staticMutatorMap)) {
|
||||
body.push(util.buildDefineProperties(staticMutatorMap, className));
|
||||
staticProps = util.buildDefineProperties(staticMutatorMap, className);
|
||||
}
|
||||
|
||||
if (instanceProps || staticProps) {
|
||||
instanceProps = instanceProps || b.literal(null);
|
||||
staticProps = staticProps || b.literal(null);
|
||||
|
||||
body.push(b.expressionStatement(
|
||||
b.callExpression(file.addDeclaration("class-props"), [className, staticProps, instanceProps])
|
||||
));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user