Permalink
Browse files

Merge branch 'master' of github.com:ender-js/Ender

  • Loading branch information...
2 parents f9c9729 + 5f56346 commit 6e45759b435ef4fa67fdd34f830d6c78d31cf8ef @rvagg rvagg committed Apr 7, 2012
Showing with 9 additions and 9 deletions.
  1. +8 −8 lib/ender.file.js
  2. +1 −1 package.json
View
@@ -28,23 +28,23 @@ ENDER.file = module.exports = {
, token = '"Ender: preserved comment block"'
, reMultiComments = /\/\*![\s\S]*?\*\//g
- // we add a comma because uglify does too
- , reTokens = RegExp(token + ',', 'g')
+ , reTokens = RegExp(token, 'g')
, tok
, ast
, c
-
source = source.replace(reMultiComments, function(comment) {
comments.push(comment)
- return ';' + token + ';'
+ return token
})
tok = uglifyJS.parser.tokenizer(source)
c = tok()
ast = uglifyJS.parser.parse(source)
ast = uglifyJS.uglify.ast_mangle(ast)
- ast = uglifyJS.uglify.ast_squeeze(ast)
+ ast = uglifyJS.uglify.ast_squeeze(ast, {
+ make_seqs: false
+ })
source = uglifyJS.uglify.gen_code(ast)
source = source.replace(reTokens, function() {
@@ -145,7 +145,7 @@ ENDER.file = module.exports = {
ENDER.file.processPackages(packages, options, function (err, result) {
result = result.join('\n\n')
if (options.sandbox) {
- result = ['!function () {', result, '}.call({});'].join('\n\n')
+ result = ['(function () {', result, '}).call({});'].join('\n\n')
}
callback(null, result)
})
@@ -445,7 +445,7 @@ ENDER.file = module.exports = {
, strippedName = packageName.replace(/.*(?=\/)\//, '')
if (source && packageName != 'ender-js' && !options.noop) {
- source = [ '!function () {\n\n var module = { exports: {} }, exports = module.exports;'
+ source = [ '(function () {\n\n var module = { exports: {} }, exports = module.exports;'
, source.replace(/\n/g, '\n ')
, 'provide("' + strippedName + '", module.exports);'
]
@@ -460,7 +460,7 @@ ENDER.file = module.exports = {
source.push('$.ender(module.exports);')
}
- source = source.join('\n\n ') + '\n\n}();'
+ source = source.join('\n\n ') + '\n\n}());'
}
if (options.sandbox && packageName == 'ender-js') {
View
@@ -1,7 +1,7 @@
{
"name": "ender"
, "description": "Open Module JavaScript Framework"
- , "version": "0.8.6"
+ , "version": "0.8.8"
, "authors": [
"Jacob Thornton <jacob@twitter.com> (https://github.com/fat)"
, "Dustin Diaz <dustin@obvious.com> (https://github.com/ded)"

0 comments on commit 6e45759

Please sign in to comment.