LightTable / Javascript

Javascript language plugin for Light Table
MIT License
56 stars 79 forks source link

SyntaxError: Illegal return statement #18

Open cldwalker opened 8 years ago

cldwalker commented 8 years ago

As reported in this issue, unable to eval in a js file because it syntax errors out. Steps to reproduce:

SyntaxError: Illegal return statement
    at Object.exports.runInContext (vm.js:43:16)
    at sbRequire (/Users/me/Library/Application Support/LightTable/plugins/Javascript/node/ltnodeclient.js:99:10)
    at init (/Users/me/Library/Application Support/LightTable/plugins/Javascript/node/ltnodeclient.js:121:3)
    at Socket.<anonymous> (/Users/me/Library/Application Support/LightTable/plugins/Javascript/node/ltnodeclient.js:20:5)
    at emitNone (events.js:72:20)
    at Socket.emit (events.js:166:7)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1033:10)

Edit: Original SyntaxError fixed by https://github.com/LightTable/Javascript/commit/58c00b127fbfa5df2c8727c9e60772e6da37b497

The fix will involve understanding how code is being involved in ltnodeclient.js. Pull requests are welcome until the core team has time to look at this

prakharcipher commented 6 years ago

I'd like to fix this. Please guide me through the code flow for this.