From 74392470950a82eb1d6283d38ada2d7c7e053c90 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Tue, 6 Jan 2015 16:45:39 +1100 Subject: [PATCH] change spread call expression context from null to undefined --- lib/6to5/transformation/transformers/es6-spread.js | 4 ++-- lib/6to5/types/index.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/6to5/transformation/transformers/es6-spread.js b/lib/6to5/transformation/transformers/es6-spread.js index 2f544fe989..5a7b031ce1 100644 --- a/lib/6to5/transformation/transformers/es6-spread.js +++ b/lib/6to5/transformation/transformers/es6-spread.js @@ -59,7 +59,7 @@ exports.CallExpression = function (node, parent, file, scope) { var args = node.arguments; if (!hasSpread(args)) return; - var contextLiteral = t.literal(null); + var contextLiteral = t.identifier("undefined"); node.arguments = []; @@ -99,7 +99,7 @@ exports.NewExpression = function (node, parent, file) { var args = node.arguments; if (!hasSpread(args)) return; - var nativeType = t.isIdentifier(node.callee) && _.contains(t.NATIVE_TYPES_NAMES, node.callee.name); + var nativeType = t.isIdentifier(node.callee) && _.contains(t.NATIVE_TYPE_NAMES, node.callee.name); var nodes = build(args, file); diff --git a/lib/6to5/types/index.js b/lib/6to5/types/index.js index efe141328f..e1f0b9ec90 100644 --- a/lib/6to5/types/index.js +++ b/lib/6to5/types/index.js @@ -3,7 +3,7 @@ var _ = require("lodash"); var t = exports; -t.NATIVE_TYPES_NAMES = ["Array", "Object", "Number", "Boolean", "Date", "Array", "String"]; +t.NATIVE_TYPE_NAMES = ["Array", "Object", "Number", "Boolean", "Date", "Array", "String"]; //