lautis / uglifier

Ruby wrapper for UglifyJS JavaScript compressor.
http://www.rubydoc.info/gems/uglifier
MIT License
613 stars 82 forks source link

During precompile uglifier fail to uglify this #104

Closed TheSynthMaster closed 7 years ago

TheSynthMaster commented 7 years ago

The following js code (from yahoo) fails to pass the latest precompile when uglifier is on

https://codepaste.net/t8to5p

It worked in previous version of uglifier... (don't know the exact one when it started to fail, the last one I tried where it works is 2.7.2

Any idea? the error message is:

C:\jrails4_update\applications\assetsolutions>rake assets:precompile --trace Invoke assets:precompile (first_time) Invoke assets:environment (first_time) Execute assets:environment Invoke environment (first_time) Execute environment Execute assets:precompile rake aborted! ExecJS::RuntimeError: undefined: SyntaxError: Unexpected token: name (el) C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:39:in exec' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:21:ineval' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:46:in call' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/uglifier-3.0.4/lib/uglifier.rb:184:inrun_uglifyjs' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/uglifier-3.0.4/lib/uglifier.rb:146:in compile' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb:53:incall' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb:28:in call' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:75:incall_processor' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:57:in block in call_processors' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:inreverse_each' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in call_processors' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/loader.rb:134:inload_from_unloaded' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/loader.rb:60:in block in load' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/loader.rb:317:infetch_asset_from_dependency_cache' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/loader.rb:44:in load' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:20:inblock in initialize' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in []' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:inload' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/base.rb:66:in find_asset' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/base.rb:73:infind_all_linked_assets' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:134:in block in find' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:133:ineach' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:133:in find' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:185:incompile' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:68:in block in define' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-3.7.1/lib/rake/sprocketstask.rb:147:inwith_logger' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:67:in block in define' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/stdlib/rake/task.rb:240:inblock in execute' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/stdlib/rake/task.rb:235:in each' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/stdlib/rake/task.rb:235:inexecute' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/stdlib/rake/task.rb:179:in block in invoke_with_call_chain' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/stdlib/monitor.rb:214:inmon_synchronize' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/stdlib/rake/task.rb:172:in invoke_with_call_chain' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/stdlib/rake/task.rb:165:ininvoke' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/stdlib/rake/application.rb:150:in invoke_task' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/stdlib/rake/application.rb:106:inblock in top_level' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/stdlib/rake/application.rb:106:in each' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/stdlib/rake/application.rb:106:inblock in top_level' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/stdlib/rake/application.rb:115:in run_with_threads' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/stdlib/rake/application.rb:100:intop_level' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/stdlib/rake/application.rb:78:in block in run' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/stdlib/rake/application.rb:176:instandard_exception_handling' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/stdlib/rake/application.rb:75:in run' C:/jrails4_update/jruby-9.1.6.0/lib/ruby/gems/shared/gems/rake-10.4.2/bin/rake:33:in

' C:/jrails4_update/jruby-9.1.6.0/bin/rake:22:in load' C:/jrails4_update/jruby-9.1.6.0/bin/rake:22:in
' Tasks: TOP => assets:precompile

lautis commented 7 years ago

The link does not work anymore :( There has been many patches to UglifyJS lately. If it's still broken in Uglifier 3.2.0, I'll look into this.