Kaffeine chokes on some return statements #22

Open
felixge opened this Issue Apr 16, 2011 · 6 comments

Comments

Projects
None yet
2 participants
@felixge

felixge commented Apr 16, 2011

Kaffeine chockes on return statements like this:

return typeof step === 'string';

The output I get is:

/var/git/transloader.transload.it/api2/node_modules/transloadit/assembly.js (compiled):254
      return typeof return step === 'string';
                    ^^^^^^

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
SyntaxError: Unexpected token return
    at Module._compile (module.js:399:25)
    at /usr/local/lib/node_modules/kaffeine/lib/index.js:94:12
    at Object..js (/var/git/transloader.transload.it/api2/node_modules/transloadit/transloadit.js:9:12)
    at Module.load (module.js:336:31)
    at Function._load (module.js:297:12)
    at require (module.js:348:19)
    at Object.<anonymous> (/var/git/transloader.transload.it/api2/node_modules/transloadit/assembly_manager.js (compiled):4:16)
    at Module._compile (module.js:404:26)
    at /usr/local/lib/node_modules/kaffeine/lib/index.js:94:12
    at Object..js (/var/git/transloader.transload.it/api2/node_modules/transloadit/transloadit.js:9:12)

The problem goes way when changing my line to:

return (typeof step === 'string');

But since my code was valid JS to begin with, I think this is probably a bug.

@weepy

This comment has been minimized.

Show comment
Hide comment
@weepy

weepy Apr 16, 2011

Owner

Yep that's a bug. Easy to fix luckily

Tapped on my fone

On 16 Apr 2011, at 18:09, felixge
reply@reply.github.com
wrote:

Kaffeine chockes on return statements like this:

return typeof step === 'string';

The output I get is:

/var/git/transloader.transload.it/api2/node_modules/transloadit/assembly.js (compiled):254
return typeof return step === 'string';
^^^^^^

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
SyntaxError: Unexpected token return
at Module._compile (module.js:399:25)
at /usr/local/lib/node_modules/kaffeine/lib/index.js:94:12
at Object..js (/var/git/transloader.transload.it/api2/node_modules/transloadit/transloadit.js:9:12)
at Module.load (module.js:336:31)
at Function._load (module.js:297:12)
at require (module.js:348:19)
at Object. (/var/git/transloader.transload.it/api2/node_modules/transloadit/assembly_manager.js (compiled):4:16)
at Module._compile (module.js:404:26)
at /usr/local/lib/node_modules/kaffeine/lib/index.js:94:12
at Object..js (/var/git/transloader.transload.it/api2/node_modules/transloadit/transloadit.js:9:12)

The problem goes way when changing my line to:

return (typeof step === 'string');

But since my code was valid JS to begin with, I think this is probably a bug.

Reply to this email directly or view it on GitHub:
#22

Owner

weepy commented Apr 16, 2011

Yep that's a bug. Easy to fix luckily

Tapped on my fone

On 16 Apr 2011, at 18:09, felixge
reply@reply.github.com
wrote:

Kaffeine chockes on return statements like this:

return typeof step === 'string';

The output I get is:

/var/git/transloader.transload.it/api2/node_modules/transloadit/assembly.js (compiled):254
return typeof return step === 'string';
^^^^^^

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
SyntaxError: Unexpected token return
at Module._compile (module.js:399:25)
at /usr/local/lib/node_modules/kaffeine/lib/index.js:94:12
at Object..js (/var/git/transloader.transload.it/api2/node_modules/transloadit/transloadit.js:9:12)
at Module.load (module.js:336:31)
at Function._load (module.js:297:12)
at require (module.js:348:19)
at Object. (/var/git/transloader.transload.it/api2/node_modules/transloadit/assembly_manager.js (compiled):4:16)
at Module._compile (module.js:404:26)
at /usr/local/lib/node_modules/kaffeine/lib/index.js:94:12
at Object..js (/var/git/transloader.transload.it/api2/node_modules/transloadit/transloadit.js:9:12)

The problem goes way when changing my line to:

return (typeof step === 'string');

But since my code was valid JS to begin with, I think this is probably a bug.

Reply to this email directly or view it on GitHub:
#22

@weepy

This comment has been minimized.

Show comment
Hide comment
@weepy

weepy Apr 16, 2011

Owner

please let me know with any other return statements that don't work as expected ...

Owner

weepy commented Apr 16, 2011

please let me know with any other return statements that don't work as expected ...

@weepy

This comment has been minimized.

Show comment
Hide comment
@weepy

weepy Apr 17, 2011

Owner

I think what I need to do here is create the concept of operators such as

unary

  • var
  • return
  • throw
  • typeof

binary

  • instanceof
Owner

weepy commented Apr 17, 2011

I think what I need to do here is create the concept of operators such as

unary

  • var
  • return
  • throw
  • typeof

binary

  • instanceof
@weepy

This comment has been minimized.

Show comment
Hide comment
@weepy

weepy Apr 17, 2011

Owner

for the moment I've pushed an easy fix for this - you suggested there was some other cases where it choked?

Owner

weepy commented Apr 17, 2011

for the moment I've pushed an easy fix for this - you suggested there was some other cases where it choked?

@felixge

This comment has been minimized.

Show comment
Hide comment
@felixge

felixge Apr 17, 2011

I have the same problem with instanceof. For example:

return file instanceof StreamFile

Produces the same issues.

felixge commented Apr 17, 2011

I have the same problem with instanceof. For example:

return file instanceof StreamFile

Produces the same issues.

@weepy

This comment has been minimized.

Show comment
Hide comment
@weepy

weepy Apr 18, 2011

Owner

I've pushed a fix for this - also fixes the problem with the regexs

Owner

weepy commented Apr 18, 2011

I've pushed a fix for this - also fixes the problem with the regexs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment