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

Allow rest argument list in abstract closures #572

Closed
legendecas opened this issue Feb 20, 2024 · 0 comments · Fixed by #573
Closed

Allow rest argument list in abstract closures #572

legendecas opened this issue Feb 20, 2024 · 0 comments · Fixed by #573

Comments

@legendecas
Copy link
Member

legendecas commented Feb 20, 2024

ecmarkup complains about a rest arguments list in an abstract closure declaration, such as:

<emu-alg>
  1. If IsCallable(_fn_) is false, throw a TypeError exception.
  1. Let _closure_ be a new Abstract Closure with parameters (..._args_) that captures _fn_ and performs the following steps when called:
    1. Let _thisArgument_ be the *this* value.
    1. Let _result_ be Completion(Call(_fn_, _thisArgument_, _args_)).
    1. Return _result_.
  1. Let _length_ be ? LengthOfArrayLike(_fn_).
  1. Let _name_ be ? Get(_fn_, *"name"*).
  1. If _name_ is not a String, set _name_ to the empty String.
  1. Return CreateBuiltinFunction(_closure_, _length_, _name_, &laquo; &raquo;).
</emu-alg>

Run with command ecmarkup --verbose --lint-spec spec.html build/index.html, and it outputs errors:

[2024-02-20T16:42:00.406Z] Error: spec.html:903:71: expected to find a parameter name here
[2024-02-20T16:42:01.873Z] Completed with errors.
error: expected to find a parameter name here (bad-ac) at spec.html:903:71:
> 903 |           1. Let _closure_ be a new Abstract Closure with parameters (..._args_) that captures _fn_ and performs the following steps when called:

This pattern can be handy compared to the exotic function object language.

Refs: tc39/proposal-async-context#68 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant