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

GetField and SetField do not have the same behavior when the accessor is undefined #44

Open
progval opened this issue Jul 4, 2014 · 0 comments

Comments

@progval
Copy link
Contributor

progval commented Jul 4, 2014

When used on a field with undefined as #getter, an explicit error is displayed:

$ echo "{[] 'foo': {#getter undefined, #setter undefined}}['foo']" | ../obj/s5.d.byte -load init.heap /dev/stdin -continue-s5-eval

Uncaught error: "[interp] (/dev/stdin:1:0-57) Applied non-function, was actually undefined"

Fatal error: exception Failure("Runtime error")

But, when setting the field instead of getting it, does not show an error at all:

$ echo "{[] 'foo': {#getter undefined, #setter undefined}}['foo' = 'bar']" | ../obj/s5.d.byte -load init.heap /dev/stdin -continue-s5-eval
Fatal error: exception Failure("Runtime error")

When reading the source code (at https://github.com/brownplt/LambdaS5/blob/master/src/ljs/ljs_eval.ml#L529), I noticed that it should display an error message, but the eprintf calls seem not to do anything (replacing them with print_string shows Uncaught exception: "unwritable-field"), but I have no idea why…

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

1 participant