es6-spread
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "es6-spread", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"homepage": "https://github.com/square/es6-spread", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -17,2 +17,4 @@ /* jshint node:true, undef:true, unused:true */ | ||
var ExpressionWithoutSideEffects = types.Type.or(n.Identifier, n.ThisExpression); | ||
/** | ||
@@ -33,3 +35,3 @@ * Visits a node of an AST looking for spread elements in arguments. This is | ||
if (n.MemberExpression.check(callee)) { | ||
if (n.Identifier.check(callee.object)) { | ||
if (ExpressionWithoutSideEffects.check(callee.object)) { | ||
// foo.bar(...a), safe to use `foo` as context | ||
@@ -36,0 +38,0 @@ context = callee.object; |
{ | ||
"name": "es6-spread", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "ES6 spread compiled to ES5.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -12,7 +12,9 @@ /** | ||
var es6spread = require('../lib'); | ||
var es6restParams = require('es6-rest-params'); | ||
var spread = require('../lib'); | ||
var restParams = require('es6-rest-params'); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var assert = require('assert'); | ||
var RESULTS = 'test/results'; | ||
@@ -24,2 +26,6 @@ | ||
function normalize(source) { | ||
return recast.prettyPrint(recast.parse(source, { esprima: esprima })).code; | ||
} | ||
require('example-runner').runCLI(process.argv.slice(2), { | ||
@@ -34,3 +40,3 @@ transform: function(source, testName, filename) { | ||
var ast = recast.parse(source, recastOptions); | ||
ast = es6restParams.transform(es6spread.transform(ast)); | ||
ast = restParams.transform(spread.transform(ast)); | ||
var result = recast.print(ast, recastOptions); | ||
@@ -41,3 +47,9 @@ | ||
return result.code; | ||
}, | ||
context: { | ||
assertSourceEquivalent: function(expected, actual) { | ||
assert.equal(normalize('(' + expected + ')'), normalize('(' + actual + ')')); | ||
} | ||
} | ||
}); |
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
14174
16
367