Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

SyntaxError: Illegal return statement #18

Description

@cldwalker

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

  • git clone https://gerrit.wikimedia.org/r/p/mediawiki/services/mobileapps.git
  • Try evaling this line. Evaling will start and then throw a popup: The node process exited. You get SyntaxError: 'return' outside of function You get the following exception:
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 58c00b1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions