Skip to content

Double return statement #39

@MangelMaxime

Description

@MangelMaxime

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions