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

Optional call returns references #4

Closed
zenparsing opened this issue Feb 5, 2016 · 4 comments
Closed

Optional call returns references #4

zenparsing opened this issue Feb 5, 2016 · 4 comments

Comments

@zenparsing
Copy link

Previously EvaluateDirectCall would either throw or return an ECMAScript language value (i.e. not a Reference), but now it can return a NilReference. And since PutValue is a no-op for NilReferences, it looks like this would be allowed:

let obj = {};
obj.foo?.() = 1;

Whereas I think we'd want a ReferenceError here.

@zenparsing
Copy link
Author

Sorry, I messed up the example (I think the cascading behavior is confusing me).

let obj = {};
obj.foo?.() = 1;

(I'll fix the issue description as well.)

@nhz-io
Copy link

nhz-io commented Feb 5, 2016

Assigning to rvalue allowed now?

@claudepache
Copy link
Owner

I haven’t yet much explored the use cases for PutValue on a Nil Reference. One could indeed throw an error instead of doing nothing, in case one thinks that it is a better semantic.

@claudepache
Copy link
Owner

Those forms are removed. They will throw the same error as obj.foo() = 1.

claudepache added a commit that referenced this issue Jul 21, 2017
* Update to the most recent spec version.
* Statically forbid use in contexts like `a?.b = c` (but not `delete
a?.b`). Closes #4, closes #18.
* Remove short-circuiting piercing parentheses. Closes #19.
* Minor bugfixes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants