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

Unable to call functions assigned to hash keys #284

Closed
odino opened this issue Sep 18, 2019 · 0 comments
Closed

Unable to call functions assigned to hash keys #284

odino opened this issue Sep 18, 2019 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@odino
Copy link
Collaborator

odino commented Sep 18, 2019

⧐  x = {"key": f(){ return "hi"}}
⧐  x.key()
ERROR: HASH does not have method 'key()'
	[1:2]	x.key()
⧐  y = x.key
⧐  y()
hi
@odino odino added the bug Something isn't working label Sep 18, 2019
@odino odino added this to the 1.8.x milestone Sep 18, 2019
odino added a commit that referenced this issue Oct 31, 2019
Previously, if an hash had a function defined (ie. `obj = {"fn": f(){ return "hello"}}`)
you couldn't directly invoke the function with `obk.fn()` but you had to
"dereference" it first (eg. `fn = obj.fn; fn()`). This has been fixed with
this PR, adding a bunch more tests, relevant docs and preparing for a new
patch release.
@odino odino closed this as completed in c7012b7 Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant