Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#14998 closed bug (notabug)

Yuglify fails to parse jquery.js

Reported by: jon.dufresne@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.0
Keywords: Cc:
Blocked by: Blocking:

Description

Steps to reproduce:

$ rm -rf bower_components && bower cache clean && bower install jquery#~1.11
bower deleted       Cached package jquery: /home/jon/.cache/bower/packages/fe2fe255e91d251051d543998aa8327a/1.11.0
bower jquery#~1.11          not-cached git://github.com/jquery/jquery.git#~1.11
bower jquery#~1.11             resolve git://github.com/jquery/jquery.git#~1.11
bower jquery#~1.11            download https://github.com/jquery/jquery/archive/1.11.0.tar.gz
bower jquery#~1.11             extract archive.tar.gz
bower jquery#~1.11            resolved git://github.com/jquery/jquery.git#1.11.0
bower jquery#~1.11             install jquery#1.11.0

jquery#1.11.0 bower_components/jquery

$ yuglify bower_components/jquery/dist/jquery.js 
Compressing bower_components/jquery/dist/jquery.js...

/home/jon/node_modules/yuglify/bin/yuglify:111
                    throw(err);
                          ^
Error
    at new JS_Parse_Error (/home/jon/node_modules/yuglify/node_modules/uglify-js/lib/parse-js.js:263:18)
    at js_error (/home/jon/node_modules/yuglify/node_modules/uglify-js/lib/parse-js.js:271:11)
    at croak (/home/jon/node_modules/yuglify/node_modules/uglify-js/lib/parse-js.js:733:9)
    at token_error (/home/jon/node_modules/yuglify/node_modules/uglify-js/lib/parse-js.js:740:9)
    at unexpected (/home/jon/node_modules/yuglify/node_modules/uglify-js/lib/parse-js.js:746:9)
    at /home/jon/node_modules/yuglify/node_modules/uglify-js/lib/parse-js.js:1112:13
    at maybe_unary (/home/jon/node_modules/yuglify/node_modules/uglify-js/lib/parse-js.js:1209:19)
    at expr_ops (/home/jon/node_modules/yuglify/node_modules/uglify-js/lib/parse-js.js:1236:24)
    at maybe_conditional (/home/jon/node_modules/yuglify/node_modules/uglify-js/lib/parse-js.js:1240:20)
    at maybe_assign (/home/jon/node_modules/yuglify/node_modules/uglify-js/lib/parse-js.js:1264:20)
    at /home/jon/node_modules/yuglify/node_modules/uglify-js/lib/parse-js.js:1278:20
    at vardefs (/home/jon/node_modules/yuglify/node_modules/uglify-js/lib/parse-js.js:1065:32)
    at var_ (/home/jon/node_modules/yuglify/node_modules/uglify-js/lib/parse-js.js:1077:26)

As many asset pipelines concatenate JavaScript files and then use minifiers on the final result, this breaks asset pipelines that use Yuglify. Django-pipeline is one such case that uses Yuglify by default. http://django-pipeline.readthedocs.org/en/latest/

Yuglify is installable through npm.

Change History (3)

comment:1 Changed 6 years ago by jon.dufresne@…

I just verified that yuflify parses 1.10 no problem.

$ rm -rf bower_components && bower cache clean && bower install jquery#~1.10
bower deleted       Cached package jquery: /home/jon/.cache/bower/packages/fe2fe255e91d251051d543998aa8327a/1.10.2
bower jquery#~1.10          not-cached git://github.com/jquery/jquery.git#~1.10
bower jquery#~1.10             resolve git://github.com/jquery/jquery.git#~1.10
bower jquery#~1.10            download https://github.com/jquery/jquery/archive/1.10.2.tar.gz
bower jquery#~1.10             extract archive.tar.gz
bower jquery#~1.10            resolved git://github.com/jquery/jquery.git#1.10.2
bower jquery#~1.10             install jquery#1.10.2

jquery#1.10.2 bower_components/jquery

$ yuglify bower_components/jquery/jquery.js 
Compressing bower_components/jquery/jquery.js...
Successfully generated JS file: bower_components/jquery/jquery.min.js

comment:2 Changed 6 years ago by gibson042

Resolution: notabug
Status: newclosed

Given that every jQuery build is validated with JSHint and tested successfully in many browsers, this is almost certainly a yuglify issue. But please come back here if you identify a specific line or expression we should look at.

comment:3 Changed 6 years ago by jon.dufresne@…

In case anyone is interested, I filed a bug with Yuglify: <https://github.com/yui/yuglify/issues/19>

Note: See TracTickets for help on using tickets.