jkarsrud / ember-cli-defeatureify

Ember-CLI addon to defeatureify your apps
MIT License
18 stars 6 forks source link

Populating "debugStatements" with "console.log" entry causes error #18

Open notmessenger opened 8 years ago

notmessenger commented 8 years ago
defeatureify: {
      'enableStripDebug': true,
      'debugStatements': [
        'Ember.default.warn',
        'Ember.default.assert',
        'Ember.default.deprecate',
        'Ember.default.debug',
        'Ember.default.Logger.assert',
        'Ember.default.Logger.debug',
        'Ember.default.Logger.error',
        'Ember.default.Logger.info',
        'Ember.default.Logger.log',
        'Ember.default.Logger.warn',
        'console.assert',
        'console.clear',
        'console.count',
        'console.debug',
        'console.dir',
        'console.dirxml',
        'console.error',
        'console.group',
        'console.groupCollapsed',
        'console.groupEnd',
        'console.info',
//      'console.log',
        'console.profile',
        'console.profileEnd',
        'console.select',
        'console.table',
        'console.time',
        'console.timeEnd',
        'console.trace',
        'console.warn'
      ],
      'features': {}
    }

If uncomment the console.log entry in the above configuration the error below is thrown. Have not had this issue when using a different version of Ember and this addon, but while using Ember 2.1.0 and version 1.1.1 of this addon it occurs:

Build failed.
File: assets/vendor.js (88398:229)
Unexpected token: punc ())
Error
    at new JS_Parse_Error (eval at <anonymous> (/Users/me/projects/myApp/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/tools/node.js:1:0), <anonymous>:1508:18)
    at js_error (eval at <anonymous> (/Users/me/projects/myApp/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/tools/node.js:1:0), <anonymous>:1516:11)
    at croak (eval at <anonymous> (/Users/me/projects/myApp/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/tools/node.js:1:0), <anonymous>:2008:9)
    at token_error (eval at <anonymous> (/Users/me/projects/myApp/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/tools/node.js:1:0), <anonymous>:2016:9)
    at unexpected (eval at <anonymous> (/Users/me/projects/myApp/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/tools/node.js:1:0), <anonymous>:2022:9)
    at eval (eval at <anonymous> (/Users/me/projects/myApp/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/tools/node.js:1:0), <anonymous>:2112:17)
    at eval (eval at <anonymous> (/Users/me/projects/myApp/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/tools/node.js:1:0), <anonymous>:2055:24)
    at block_ (eval at <anonymous> (/Users/me/projects/myApp/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/tools/node.js:1:0), <anonymous>:2335:20)
    at eval (eval at <anonymous> (/Users/me/projects/myApp/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/tools/node.js:1:0), <anonymous>:2308:25)
    at function_ (eval at <anonymous> (/Users/me/projects/myApp/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/tools/node.js:1:0), <anonymous>:2313:15)