s-a / sublime-text-refactor

A Sublime Text Refactor Plugin for Javascript Code
213 stars 12 forks source link

Long error #16

Closed patrickyan closed 11 years ago

patrickyan commented 11 years ago

When trying to do anything i get this error:

WARN: ERROR: Unexpected token: punc (,) [null:406,2]

/Users/Pat/Library/Application Support/Sublime Text 2/Packages/JavaScript Refactor/js/node_modules/uglify-js/lib/parse.js:199
    throw new JS_Parse_Error(message, line, col, pos);
          ^
Error
    at new JS_Parse_Error (/Users/Pat/Library/Application Support/Sublime Text 2/Packages/JavaScript Refactor/js/node_modules/uglify-js/lib/parse.js:185:18)
    at js_error (/Users/Pat/Library/Application Support/Sublime Text 2/Packages/JavaScript Refactor/js/node_modules/uglify-js/lib/parse.js:199:11)
    at croak (/Users/Pat/Library/Application Support/Sublime Text 2/Packages/JavaScript Refactor/js/node_modules/uglify-js/lib/parse.js:630:9)
    at token_error (/Users/Pat/Library/Application Support/Sublime Text 2/Packages/JavaScript Refactor/js/node_modules/uglify-js/lib/parse.js:638:9)
    at unexpected (/Users/Pat/Library/Application Support/Sublime Text 2/Packages/JavaScript Refactor/js/node_modules/uglify-js/lib/parse.js:644:9)
    at /Users/Pat/Library/Application Support/Sublime Text 2/Packages/JavaScript Refactor/js/node_modules/uglify-js/lib/parse.js:724:17
    at /Users/Pat/Library/Application Support/Sublime Text 2/Packages/JavaScript Refactor/js/node_modules/uglify-js/lib/parse.js:677:24
    at block_ (/Users/Pat/Library/Application Support/Sublime Text 2/Packages/JavaScript Refactor/js/node_modules/uglify-js/lib/parse.js:938:20)
    at ctor.body (/Users/Pat/Library/Application Support/Sublime Text 2/Packages/JavaScript Refactor/js/node_modules/uglify-js/lib/parse.js:911:25)
    at function_ (/Users/Pat/Library/Application Support/Sublime Text 2/Packages/JavaScript Refactor/js/node_modules/uglify-js/lib/parse.js:916:15)
s-a commented 11 years ago

@patrickyan JS_Parse_Error sounds like a syntax error in your JavaScript file. Maybe in line 406?

patrickyan commented 11 years ago

Ah that's right. My fault :)

granteagon commented 9 years ago

I'm getting this error in ember-cli which uses ES6 syntax.

The line is:

import Ember from 'ember';

Is there a solution for this?

s-a commented 9 years ago

Sorry there is no ES6 support for this plugin.

s-a commented 9 years ago

Just created a ticket for es6 feature request at #24