From 2e5626b13ee719d44b085729e56654f21b1801b0 Mon Sep 17 00:00:00 2001 From: Brian Donovan Date: Fri, 3 Apr 2015 08:33:32 -0700 Subject: [PATCH] Fix inserting multiple strings at the beginning of the source. The fix updates magic-string to include Rich-Harris/magic-string#10. --- package.json | 8 ++++---- test/decaffeinate_test.js | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index fb2390812..4d2281977 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "license": "MIT", "dependencies": { "coffee-script-redux": "git://github.com/michaelficarra/CoffeeScriptRedux", - "magic-string": "^0.4.5" + "magic-string": "^0.4.7" }, "files": [ "bin/decaffeinate", @@ -35,9 +35,9 @@ "src/**/*.js" ], "devDependencies": { - "babel": "^4.7.7", - "gobble": "^0.7.6", - "gobble-babel": "^4.0.1", + "babel": "^5.0.6", + "gobble": "^0.7.10", + "gobble-babel": "^5.0.0", "gobble-cli": "^0.3.5", "mocha": "^2.2.1" } diff --git a/test/decaffeinate_test.js b/test/decaffeinate_test.js index 89bda30ff..765edf0df 100644 --- a/test/decaffeinate_test.js +++ b/test/decaffeinate_test.js @@ -448,6 +448,10 @@ describe('automatic conversions', function() { it('adds pre-declarations at the right indent level when the assignment is in an expression context', function() { check(`->\n a(b = c)`, `(function() {\n var b;\n return a(b = c);\n});`); }); + + it('adds pre-declarations and regular declarations together properly', function() { + check('a = 1\nb = c = 2', 'var c;\nvar a = 1;\nvar b = c = 2;'); + }); }); describe('adding explicit returns', function() {