Emit Object.assign for spread for targets >= ES6

This commit is contained in:
Nathan Shively-Sanders 2017-01-30 10:42:11 -08:00
parent 5282a8d0f5
commit a67a749331

View File

@ -402,7 +402,7 @@ namespace ts {
};
export function createAssignHelper(context: TransformationContext, attributesSegments: Expression[]) {
if (context.getCompilerOptions().target === ScriptTarget.ES2015) {
if (context.getCompilerOptions().target >= ScriptTarget.ES2015) {
return createCall(createPropertyAccess(createIdentifier("Object"), "assign"),
/*typeArguments*/ undefined,
attributesSegments);