babel-plugin-tailcall-optimization
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -32,7 +32,7 @@ 'use strict'; | ||
var assignmentsToTmpInputs = tmpInputVariables.map(function (tmpInputVar, index) { | ||
return t.assignmentExpression('=', tmpInputVar, tailCall.node.argument.arguments[index]); | ||
return t.expressionStatement(t.assignmentExpression('=', tmpInputVar, tailCall.node.argument.arguments[index])); | ||
}); | ||
// and then we do a swap | ||
var swapTmpInputWithInput = inputVariables.map(function (inputVar, index) { | ||
return t.assignmentExpression('=', inputVar, tmpInputVariables[index]); | ||
return t.expressionStatement(t.assignmentExpression('=', inputVar, tmpInputVariables[index])); | ||
}); | ||
@@ -55,8 +55,6 @@ | ||
if (path.node.id) { | ||
var _findTailCalls = findTailCalls(path, path.node.id.name); | ||
var _findTailCalls = findTailCalls(path, path.node.id.name), | ||
tailCalls = _findTailCalls.tailCalls, | ||
needsClosure = _findTailCalls.needsClosure; | ||
var tailCalls = _findTailCalls.tailCalls; | ||
var needsClosure = _findTailCalls.needsClosure; | ||
if (tailCalls.length > 0 && !needsClosure) { | ||
@@ -72,8 +70,6 @@ optimizeTailCalls(path, tailCalls, needsClosure); | ||
var _findTailCalls2 = findTailCalls(functionBody, functionName); | ||
var _findTailCalls2 = findTailCalls(functionBody, functionName), | ||
tailCalls = _findTailCalls2.tailCalls, | ||
needsClosure = _findTailCalls2.needsClosure; | ||
var tailCalls = _findTailCalls2.tailCalls; | ||
var needsClosure = _findTailCalls2.needsClosure; | ||
if (tailCalls.length > 0 && !needsClosure) { | ||
@@ -80,0 +76,0 @@ // @todo for now when closure is detected skip TCO - we should implement it also in that case |
{ | ||
"name": "babel-plugin-tailcall-optimization", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "Tail call optimization for JavaScript!", | ||
@@ -28,10 +28,5 @@ "main": "build/lib.js", | ||
"homepage": "https://github.com/krzkaczor/babel-plugin-tailcall-optimization", | ||
"dependencies": { | ||
"devDependencies": { | ||
"babel-cli": "^6.11.0", | ||
"babel-core": "^6.13.0", | ||
"babel-preset-es2015": "^6.13.0", | ||
"babel-traverse": "^6.13.0", | ||
"babylon": "^6.8.0" | ||
}, | ||
"devDependencies": { | ||
"babel-register": "6.11.6", | ||
@@ -43,2 +38,6 @@ "benchmark": "2.1.1", | ||
}, | ||
"peerDependencies": { | ||
"babel-core": "^6.0.0", | ||
"babel-traverse": "^6.13.0" | ||
}, | ||
"standard": { | ||
@@ -45,0 +44,0 @@ "env": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
48547
2
16
7
- Removedbabel-cli@^6.11.0
- Removedbabel-core@^6.13.0
- Removedbabel-preset-es2015@^6.13.0
- Removedbabel-traverse@^6.13.0
- Removedbabylon@^6.8.0
- Removedanymatch@1.3.2(transitive)
- Removedarr-diff@2.0.04.0.0(transitive)
- Removedarr-flatten@1.1.0(transitive)
- Removedarr-union@3.1.0(transitive)
- Removedarray-unique@0.2.10.3.2(transitive)
- Removedassign-symbols@1.0.0(transitive)
- Removedasync-each@1.0.6(transitive)
- Removedatob@2.1.2(transitive)
- Removedbabel-cli@6.26.0(transitive)
- Removedbabel-helper-call-delegate@6.24.1(transitive)
- Removedbabel-helper-define-map@6.26.0(transitive)
- Removedbabel-helper-function-name@6.24.1(transitive)
- Removedbabel-helper-get-function-arity@6.24.1(transitive)
- Removedbabel-helper-hoist-variables@6.24.1(transitive)
- Removedbabel-helper-optimise-call-expression@6.24.1(transitive)
- Removedbabel-helper-regex@6.26.0(transitive)
- Removedbabel-helper-replace-supers@6.24.1(transitive)
- Removedbabel-plugin-check-es2015-constants@6.22.0(transitive)
- Removedbabel-plugin-transform-es2015-arrow-functions@6.22.0(transitive)
- Removedbabel-plugin-transform-es2015-block-scoped-functions@6.22.0(transitive)
- Removedbabel-plugin-transform-es2015-block-scoping@6.26.0(transitive)
- Removedbabel-plugin-transform-es2015-classes@6.24.1(transitive)
- Removedbabel-plugin-transform-es2015-computed-properties@6.24.1(transitive)
- Removedbabel-plugin-transform-es2015-destructuring@6.23.0(transitive)
- Removedbabel-plugin-transform-es2015-duplicate-keys@6.24.1(transitive)
- Removedbabel-plugin-transform-es2015-for-of@6.23.0(transitive)
- Removedbabel-plugin-transform-es2015-function-name@6.24.1(transitive)
- Removedbabel-plugin-transform-es2015-literals@6.22.0(transitive)
- Removedbabel-plugin-transform-es2015-modules-amd@6.24.1(transitive)
- Removedbabel-plugin-transform-es2015-modules-commonjs@6.26.2(transitive)
- Removedbabel-plugin-transform-es2015-modules-systemjs@6.24.1(transitive)
- Removedbabel-plugin-transform-es2015-modules-umd@6.24.1(transitive)
- Removedbabel-plugin-transform-es2015-object-super@6.24.1(transitive)
- Removedbabel-plugin-transform-es2015-parameters@6.24.1(transitive)
- Removedbabel-plugin-transform-es2015-shorthand-properties@6.24.1(transitive)
- Removedbabel-plugin-transform-es2015-spread@6.22.0(transitive)
- Removedbabel-plugin-transform-es2015-sticky-regex@6.24.1(transitive)
- Removedbabel-plugin-transform-es2015-template-literals@6.22.0(transitive)
- Removedbabel-plugin-transform-es2015-typeof-symbol@6.23.0(transitive)
- Removedbabel-plugin-transform-es2015-unicode-regex@6.24.1(transitive)
- Removedbabel-plugin-transform-regenerator@6.26.0(transitive)
- Removedbabel-plugin-transform-strict-mode@6.24.1(transitive)
- Removedbabel-polyfill@6.26.0(transitive)
- Removedbabel-preset-es2015@6.24.1(transitive)
- Removedbase@0.11.2(transitive)
- Removedbinary-extensions@1.13.1(transitive)
- Removedbindings@1.5.0(transitive)
- Removedbraces@1.8.52.3.2(transitive)
- Removedcache-base@1.0.1(transitive)
- Removedchokidar@1.7.0(transitive)
- Removedclass-utils@0.3.6(transitive)
- Removedcollection-visit@1.0.0(transitive)
- Removedcommander@2.20.3(transitive)
- Removedcomponent-emitter@1.3.1(transitive)
- Removedcopy-descriptor@0.1.1(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removeddefine-property@0.2.51.0.02.0.2(transitive)
- Removedexpand-brackets@0.1.52.1.4(transitive)
- Removedexpand-range@1.8.2(transitive)
- Removedextend-shallow@2.0.13.0.2(transitive)
- Removedextglob@0.3.22.0.4(transitive)
- Removedfile-uri-to-path@1.0.0(transitive)
- Removedfilename-regex@2.0.1(transitive)
- Removedfill-range@2.2.44.0.0(transitive)
- Removedfor-in@1.0.2(transitive)
- Removedfor-own@0.1.5(transitive)
- Removedfragment-cache@0.2.1(transitive)
- Removedfs-readdir-recursive@1.1.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfsevents@1.2.13(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-value@2.0.6(transitive)
- Removedglob@7.2.3(transitive)
- Removedglob-base@0.3.0(transitive)
- Removedglob-parent@2.0.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-value@0.3.11.0.0(transitive)
- Removedhas-values@0.1.41.0.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-accessor-descriptor@1.0.1(transitive)
- Removedis-binary-path@1.0.1(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-data-descriptor@1.0.1(transitive)
- Removedis-descriptor@0.1.71.0.3(transitive)
- Removedis-dotfile@1.0.3(transitive)
- Removedis-equal-shallow@0.1.3(transitive)
- Removedis-extendable@0.1.11.0.1(transitive)
- Removedis-extglob@1.0.0(transitive)
- Removedis-glob@2.0.1(transitive)
- Removedis-number@2.1.03.0.04.0.0(transitive)
- Removedis-plain-object@2.0.4(transitive)
- Removedis-posix-bracket@0.1.1(transitive)
- Removedis-primitive@2.0.0(transitive)
- Removedis-windows@1.0.2(transitive)
- Removedisarray@1.0.0(transitive)
- Removedisobject@2.1.03.0.1(transitive)
- Removedjsesc@0.5.0(transitive)
- Removedkind-of@3.2.24.0.06.0.3(transitive)
- Removedmap-cache@0.2.2(transitive)
- Removedmap-visit@1.0.0(transitive)
- Removedmath-random@1.0.4(transitive)
- Removedmicromatch@2.3.113.1.10(transitive)
- Removedmixin-deep@1.3.2(transitive)
- Removednan@2.22.2(transitive)
- Removednanomatch@1.2.13(transitive)
- Removednormalize-path@2.1.1(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedobject-copy@0.1.0(transitive)
- Removedobject-visit@1.0.1(transitive)
- Removedobject.omit@2.0.1(transitive)
- Removedobject.pick@1.3.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedoutput-file-sync@1.1.2(transitive)
- Removedparse-glob@3.0.4(transitive)
- Removedpascalcase@0.1.1(transitive)
- Removedposix-character-classes@0.1.1(transitive)
- Removedpreserve@0.2.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedrandomatic@3.1.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedreaddirp@2.2.1(transitive)
- Removedregenerate@1.4.2(transitive)
- Removedregenerator-runtime@0.10.5(transitive)
- Removedregenerator-transform@0.10.1(transitive)
- Removedregex-cache@0.4.4(transitive)
- Removedregex-not@1.0.2(transitive)
- Removedregexpu-core@2.0.0(transitive)
- Removedregjsgen@0.2.0(transitive)
- Removedregjsparser@0.1.5(transitive)
- Removedremove-trailing-separator@1.1.0(transitive)
- Removedrepeat-element@1.1.4(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedresolve-url@0.2.1(transitive)
- Removedret@0.1.15(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsafe-regex@1.1.0(transitive)
- Removedset-value@2.0.1(transitive)
- Removedsnapdragon@0.8.2(transitive)
- Removedsnapdragon-node@2.1.1(transitive)
- Removedsnapdragon-util@3.0.1(transitive)
- Removedsource-map-resolve@0.5.3(transitive)
- Removedsource-map-url@0.4.1(transitive)
- Removedsplit-string@3.1.0(transitive)
- Removedstatic-extend@0.1.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedto-object-path@0.3.0(transitive)
- Removedto-regex@3.0.2(transitive)
- Removedto-regex-range@2.1.1(transitive)
- Removedunion-value@1.0.1(transitive)
- Removedunset-value@1.0.0(transitive)
- Removedurix@0.1.0(transitive)
- Removeduse@3.1.1(transitive)
- Removeduser-home@1.1.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedv8flags@2.1.1(transitive)
- Removedwrappy@1.0.2(transitive)