Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double return statement #39

Open
MangelMaxime opened this issue Jun 13, 2016 · 0 comments
Open

Double return statement #39

MangelMaxime opened this issue Jun 13, 2016 · 0 comments

Comments

@MangelMaxime
Copy link

Hello,

it's seems like starlight is adding a return []; statement at the end of a function.

The problem is when we specify an explicit return statement like so:

function increment ()
  counter = counter + 1
  updateUI()
  return ""
end

It will generate the following Javascript:

$set($, 'increment', (__star_tmp = function func$increment(...args){let $3 = $1.extend(), $ = $3;
;
$set($, 'counter', __star_op_add($get($, 'counter'), 1));
__star_call($get($, 'updateUI'));
return [""];; return [];}, __star_tmp.toString=()=>'function: 0x2', __star_tmp));

Here we saw that there two return statement the explicit and implicit one. So browsers like Firefox are emitting a warning.

For information, I am using the grunt configuration.

paulcuth pushed a commit that referenced this issue Aug 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants