Skip to content

Yuglify fails to parse jquery.js #19

@jdufresne

Description

@jdufresne

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)

This failure to parse occurred some time between jQuery 1.10 and 1.11 as 1.10 parses fine:

$ 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

I submitted a bug to jQuery, but they believe this is a Yuglify bug. See: http://bugs.jquery.com/ticket/14998

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions