Skip to content
This repository
Browse code

sync with 0.8.x 5f56346 to fix for Uglify #339

  • Loading branch information...
commit 5431dd6564a91f737bd14db698d2df2abe8b036a 1 parent 9ba05d7
Rod Vagg rvagg authored
2  lib/minify.js
@@ -40,7 +40,7 @@ var uglifyParser = require('uglify-js').parser
40 40
41 41 source = source.replace(reMultiComments, function(comment) {
42 42 comments.push(comment)
43   - return ';' + token + ';'
  43 + return token
44 44 })
45 45
46 46 try {
14 package.json
@@ -14,13 +14,13 @@
14 14 "node": ">= 0.6.0"
15 15 }
16 16 , "dependencies": {
17   - "npm": ">= 1.1.8"
18   - , "colors": ">= 0.3.0"
19   - , "uglify-js": ">= 0.0.1"
20   - , "async": ">= 0.1.9"
  17 + "npm": ">= 1.1.16"
  18 + , "colors": ">= 0.6.0"
  19 + , "uglify-js": ">= 1.2.6"
  20 + , "async": ">= 0.1.18"
21 21 , "hogan.js": ">= 2.0.0"
22 22 , "archy": ">= 0.0.2"
23   - , "colors-tmpl": ">= 0.0.2"
  23 + , "colors-tmpl": ">= 0.0.3"
24 24 , "xregexp": ">= 1.5.3"
25 25 }
26 26 , "directories": {
@@ -30,7 +30,7 @@
30 30 , "devDependencies": {
31 31 "buster": ">= 0.4.6"
32 32 , "rimraf": ">= 2.0.1"
33   - , "jshint": ">= 0.5.9"
  33 + , "jshint": ">= 0.6.0"
34 34 }
35 35 , "bin": {
36 36 "ender": "./bin/ender"
@@ -39,4 +39,4 @@
39 39 , "scripts": {
40 40 "test": "make"
41 41 }
42   -}
  42 +}
4 resources/source-package.mustache
... ... @@ -1,5 +1,5 @@
1 1 {{^options.noop}}
2   -!function () {
  2 +(function () {
3 3
4 4 var module = { exports: {} }, exports = module.exports;
5 5 {{#mainSource}}
@@ -16,4 +16,4 @@
16 16 {{^enderSource}}
17 17 $.ender(module.exports);
18 18 {{/enderSource}}
19   -}();{{/options.noop}}{{#options.noop}}{{{mainSource.raw}}}{{/options.noop}}
  19 +}());{{/options.noop}}{{#options.noop}}{{{mainSource.raw}}}{{/options.noop}}
16 test/unit/source-package-test.js
@@ -89,7 +89,7 @@ testCase('Source package', {
89 89 // don't be too clever here so we can be clever in the code we're testing.
90 90 // source indenting should be done by the caller, not here.
91 91 var src = ''
92   - src += '!function () {\n\n var module = { exports: {} }, exports = module.exports;\n'
  92 + src += '(function () {\n\n var module = { exports: {} }, exports = module.exports;\n'
93 93 if (options.main)
94 94 src += '\n' + options.main
95 95 src += '\n provide("' + options.name + '", module.exports);'
@@ -99,7 +99,7 @@ testCase('Source package', {
99 99 src += '\n\n' + options.ender
100 100 else
101 101 src += '\n $.ender(module.exports);'
102   - src += '\n}();'
  102 + src += '\n}());'
103 103 return src
104 104 }
105 105
@@ -136,7 +136,7 @@ testCase('Source package', {
136 136 + ' 2\n'
137 137 + ' 3\n'
138 138 })
139   - , '!function () {\n\n'
  139 + , '(function () {\n\n'
140 140 + ' var module = { exports: {} }, exports = module.exports;\n\n'
141 141 + ' this is a test\n\n'
142 142 + ' 1\n'
@@ -144,7 +144,7 @@ testCase('Source package', {
144 144 + ' 3\n\n'
145 145 + ' provide("foobar", module.exports);\n'
146 146 + ' $.ender(module.exports);\n'
147   - + '}();'
  147 + + '}());'
148 148 )
149 149 }
150 150
@@ -157,14 +157,14 @@ testCase('Source package', {
157 157 + ' 2\n'
158 158 + ' 3\n'
159 159 })
160   - , '!function () {\n\n'
  160 + , '(function () {\n\n'
161 161 + ' var module = { exports: {} }, exports = module.exports;\n\n'
162 162 + ' provide("foobar", module.exports);\n\n'
163 163 + ' this is a test\n\n'
164 164 + ' 1\n'
165 165 + ' 2\n'
166 166 + ' 3\n\n'
167   - + '}();'
  167 + + '}());'
168 168 )
169 169 }
170 170
@@ -181,7 +181,7 @@ testCase('Source package', {
181 181 + ' 2\n'
182 182 + ' 3\n'
183 183 })
184   - , '!function () {\n\n'
  184 + , '(function () {\n\n'
185 185 + ' var module = { exports: {} }, exports = module.exports;\n\n'
186 186 + ' main\n\n'
187 187 + ' source\n'
@@ -191,7 +191,7 @@ testCase('Source package', {
191 191 + ' 1\n'
192 192 + ' 2\n'
193 193 + ' 3\n\n'
194   - + '}();'
  194 + + '}());'
195 195 )
196 196 }
197 197 }

0 comments on commit 5431dd6

Please sign in to comment.
Something went wrong with that request. Please try again.