[Bug] empty functions (or event handlers) are not allowed

This issue has been tracked since 2022-07-26.

it would surprise me if the following behaviour would be intended:

trying to define an empty function causes the parser to throw an error - just a comment as function body is not sufficient:

  def globalFunction ()
--    get $x
  end

throws the following error

_hyperscript.min.js:1 hyperscript errors were found on the following element: <script type=​"text/​hyperscript">​…​</script>​ 

 Expected commandList

--    get $x
                ^^

 Error: Expected commandList

--    get $x
                ^^


    at a.raiseParseError (https://127.0.0.1:7443/js/_hyperscript.min.js:1:11785)
    at a.requireElement (https://127.0.0.1:7443/js/_hyperscript.min.js:1:10734)
    at https://127.0.0.1:7443/js/_hyperscript.min.js:1:54063
    at n (https://127.0.0.1:7443/js/_hyperscript.min.js:1:11188)
    at https://127.0.0.1:7443/js/_hyperscript.min.js:1:8747
    at a.parseElement (https://127.0.0.1:7443/js/_hyperscript.min.js:1:10515)
    at a.requireElement (https://127.0.0.1:7443/js/_hyperscript.min.js:1:10706)
    at https://127.0.0.1:7443/js/_hyperscript.min.js:1:47578
    at a.parseElement (https://127.0.0.1:7443/js/_hyperscript.min.js:1:10515)
    at a.parseHyperScript (https://127.0.0.1:7443/js/_hyperscript.min.js:1:11895)

The same applies to event handlers

More Details About Repo
Owner Name bigskysoftware
Repo Name _hyperscript
Full Name bigskysoftware/_hyperscript
Language JavaScript
Created Date 2020-05-27
Updated Date 2022-11-25
Star Count 1265
Watcher Count 18
Fork Count 75
Issue Count 86

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date