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

[Bug Report] Multiple arguments are compiled to nested functions #461

Open
2 tasks done
brynne8 opened this issue Jan 1, 2020 · 1 comment
Open
2 tasks done

[Bug Report] Multiple arguments are compiled to nested functions #461

brynne8 opened this issue Jan 1, 2020 · 1 comment
Labels
syntax Suggestions to improve the syntax

Comments

@brynne8
Copy link

brynne8 commented Jan 1, 2020

Describe your issue/suggestions

吾有一術。名之曰「測試」。欲行是術。必先得三數。曰「甲」。曰「乙」。曰「丙」。乃行是術曰。
    批曰「「嗚呼哀哉。」」
是謂「測試」之術也。

is compiled to

var 測試 = () => 0;
測試 = function() {
    return function() {
        return function() {
            /*"嗚呼哀哉。"*/ };
    };
};

But my expected js is

var 測試 = () => 0;
測試 = function(, , ) {
    /*"嗚呼哀哉。"*/
};

which is clearer.

A syntax proposal

吾有術若干。名之曰「測試」「試驗」「實作」。

欲行「測試」之術。必先得三數。曰「甲」。曰「乙」。曰「丙」。乃行是術曰。
    批曰「「嗚呼哀哉。」」
是謂「測試」之術也。

欲行「試驗」之術。必先得三數。曰「甲」。曰「乙」。曰「丙」。乃行是術曰。
    批曰「「嗚呼哀哉。」」
是謂「試驗」之術也。

欲行「實作」之術。必先得三數。曰「甲」。曰「乙」。曰「丙」。乃行是術曰。
    批曰「「嗚呼哀哉。」」
是謂「實作」之術也。

Checklist

Before you create this issue, Please make sure ALL the following items are checked

  • If this is a feature request, it's NOT listed Here
  • If this is a bug report, it's NOT listed Here
@antfu
Copy link
Member

antfu commented Jan 1, 2020

This is by design, please check out #322 #362. Thanks

@antfu antfu added the syntax Suggestions to improve the syntax label Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
syntax Suggestions to improve the syntax
Projects
None yet
Development

No branches or pull requests

2 participants