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

Support computed properties for instances. #3023

Closed
wants to merge 1 commit into from

Conversation

pvolok
Copy link
Contributor

@pvolok pvolok commented Dec 15, 2016

This is needed before #2952 can be merged.

Lookup rules:

  1. If prop is a string literal (either computed or named), we look it up the prototype chain.
  2. If class has an indexer, we add it to try_ts_on_failure of LookupT (only if there is no indexer queued yet, we distinguish by the reason RObjectIndexer).

We can't check indexer earlier because some classes like node's Buffer define indexer but has a parent class.

If this PR works, we can get rid of $key and $value props and use dicttype like in ObjT.

cc @samwgoldman

@facebook-github-bot
Copy link
Contributor

@samwgoldman has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@samwgoldman samwgoldman self-assigned this Jan 10, 2017
@STRML
Copy link
Contributor

STRML commented Apr 4, 2017

This unblocks #2952 and fixes #2057 and #2310 after both PRs are merged.

@pvolok pvolok closed this Jun 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants