end must be used where the docs say it should not be required (intro)

Open
#644 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript
Domain
compilers, web-dev

Research direction

Start by reproducing the reported behavior in the linked CodePen and compare it with the introduction example in the hyperscript documentation. Confirm that the example works without the first end terminator and that the existing error no longer occurs, while preserving the shown solution's behavior.

Written by the indexing model from the issue text.

Description

codepen here: https://codepen.io/nicosql/pen/myEJmvB

Per the docs, https://hyperscript.org/docs/#introduction - the below should work without having to use end but instead it gives the below error.

Expected behavior: The below should work without having to use end

The end terminator can often be omitted for both features and statements if either of these conditions hold:

Another feature starts:
<button _="on click if true log 'Clicked!'
           on mouseenter log 'Mouse entered!'">
Click Me
</button>

error:

"hyperscript errors were found on the following element:" <button _="on click if true log 'Clicked!'
             on mouseenter log 'Mouse entered!' end">
Click Me
</button> "

" "Expected 'end' but found 'on'

             on mouseenter log 'Mouse entered!' end
              ^^

" "Error: Expected 'end' but found 'on'

solution:

<button _="on click if true log 'Clicked!' end
           on mouseenter log 'Mouse entered!'">
Click Me
</button>
Dominant language
JavaScript
Stars
3.8k
Forks
171
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bigskysoftware/_hyperscript

All issues in bigskysoftware/_hyperscript

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.