Skip to content

Commit

Permalink
Fix inserting multiple strings at the beginning of the source.
Browse files Browse the repository at this point in the history
The fix updates magic-string to include Rich-Harris/magic-string#10.
  • Loading branch information
eventualbuddha committed Apr 3, 2015
1 parent 8395aa2 commit 2e5626b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -27,17 +27,17 @@
"license": "MIT",
"dependencies": {
"coffee-script-redux": "git://github.com/michaelficarra/CoffeeScriptRedux",
"magic-string": "^0.4.5"
"magic-string": "^0.4.7"
},
"files": [
"bin/decaffeinate",
"lib/**/*.js",
"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"
}
Expand Down
4 changes: 4 additions & 0 deletions test/decaffeinate_test.js
Expand Up @@ -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() {
Expand Down

0 comments on commit 2e5626b

Please sign in to comment.