Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

Commit

Permalink
- turn off sequences which breaks the uglify compressor when in somet…
Browse files Browse the repository at this point in the history
…hing that resembles 'strict' mode

- see mishoo/UglifyJS#339
- bump package
  • Loading branch information
ded committed Mar 27, 2012
1 parent 4721e56 commit 5f56346
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/ender.file.js
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "ender"
, "description": "Open Module JavaScript Framework"
, "version": "0.8.7"
, "version": "0.8.8"
, "authors": [
"Jacob Thornton <jacob@twitter.com> (https://github.com/fat)"
, "Dustin Diaz <dustin@obvious.com> (https://github.com/ded)"
Expand Down

0 comments on commit 5f56346

Please sign in to comment.