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

Passing an object's property to a behavior results in undefined . [BUG] #550

Open
b-aaz opened this issue Jun 19, 2024 · 1 comment
Open

Comments

@b-aaz
Copy link

b-aaz commented Jun 19, 2024

<html>
        <script src="./_hyperscript.js"></script>

        <script type="text/hyperscript">
                init
                        set $obj to {a:10,b:40}
                end

                behavior logval(val)
                        on click
                                log val
                        end
                end
        </script>
        <body>
                <button _="on click log $obj.a"> <!-- >> 10 -->
                        first button
                </button>
                <button _="install logval(val: $obj.a)"> <!-- >> undefined -->
                        second button
                </button>
        </body>
</html>

It is expected for 10 to appear in the console as a result of pressing the second button but undefined is returned .

@1cg
Copy link
Contributor

1cg commented Dec 17, 2024

I would bet this is an ordering issue.

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

No branches or pull requests

2 participants