cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-13305) Docs can't build because of ES6 code usage (uglify-js error)
Date Fri, 22 Sep 2017 00:29:00 GMT

    [ https://issues.apache.org/jira/browse/CB-13305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16175720#comment-16175720
] 

ASF GitHub Bot commented on CB-13305:
-------------------------------------

Github user devgeeks commented on a diff in the pull request:

    https://github.com/apache/cordova-docs/pull/733#discussion_r140390069
  
    --- Diff: www/static/plugins/searchbar.jsx ---
    @@ -8,9 +8,9 @@ var SearchBar = createClass({
     
         // polyfill of sorts for string refs
         linkRef: function(component, name) {
    -        let cache = component._linkedRefs || (component._linkedRefs = {});
    +        var cache = component._linkedRefs || (component._linkedRefs = {});
             if (!component.refs) component.refs = {};
    -        return cache[name] || (cache[name] = c => {
    +        return cache[name] || (cache[name] = function(c) {
                 component.refs[name] = c;
    --- End diff --
    
    Ah hah. Good catch. Arrow functions have implicit returns. 


> Docs can't build because of ES6 code usage (uglify-js error)
> ------------------------------------------------------------
>
>                 Key: CB-13305
>                 URL: https://issues.apache.org/jira/browse/CB-13305
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-docs
>            Reporter: Shazron Abdullah
>            Assignee: Tommy-Carlos Williams
>
> Error:
> {code}
>     at new JS_Parse_Error (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:1534:18)
>     at js_error (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:1542:11)
>     at croak (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2089:9)
>     at token_error (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2097:9)
>     at unexpected (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2103:9)
>     at semicolon (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2123:56)
>     at simple_statement (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2314:73)
>     at eval (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2183:19)
>     at eval (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2136:24)
>     at block_ (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2429:20)
>   message: '/Users/shazron/Documents/git/apache/cordova-docs/plugins.js: SyntaxError:
Unexpected token: name (cache)',
>   fileName: '/Users/shazron/Documents/git/apache/cordova-docs/plugins.js',
>   lineNumber: 9393,
>   stack: 'Error\n    at new JS_Parse_Error (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:1534:18)\n    at js_error (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:1542:11)\n    at croak (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2089:9)\n    at token_error (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2097:9)\n    at unexpected (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2103:9)\n    at semicolon (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2123:56)\n    at simple_statement (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2314:73)\n    at eval (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2183:19)\n    at eval (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2136:24)\n    at block_ (eval at <anonymous> (/Users/shazron/Documents/git/apache/cordova-docs/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1),
<anonymous>:2429:20)',
>   showStack: false,
>   showProperties: true,
>   plugin: 'gulp-uglify' }
> {code}
> Cause of the error is usage of ES6 here:
> https://github.com/apache/cordova-docs/blame/43ab873557285a06126f6e3c92ef196ac7fb9c50/www/static/plugins/searchbar.jsx#L11-L14
> Namely the {{let}} and {{arrow function}}. There may be others.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message