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

[CLEANUP beta] Abstract chainWatchers into an object. #11819

Merged
merged 1 commit into from
Jul 24, 2015

Conversation

krisselden
Copy link
Contributor

Abstracting chainWatchers into an Object, cleans up some shape deopts, helps make stuff more clear. This is good to go, I haven't squashed yet just so it is easier for people to review updates.

@mixonic
Copy link
Member

mixonic commented Jul 20, 2015

@krisselden is green!

},

revalidateAll() {
for (let key in this.nodes) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we ever delete from this.nodes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, we just empty the array

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stefanpenner should it just search a single array or linked list of well shaped entries? like {key: 'foo', node: node} ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

array should be good, as we just do a sequential scan anyways.

@stefanpenner
Copy link
Member

@krisselden whats blocking this/

// a map of nodes that reference a key
function ChainWatchers(src) {
this.src = src;
this.nodes = Object.create(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function Empty() {}
Empty.prototype = Object.create(null);
...
this.nodes = new Empty();

@krisselden
Copy link
Contributor Author

@stefanpenner rebased and squashed

rwjblue added a commit that referenced this pull request Jul 24, 2015
[CLEANUP beta] Abstract chainWatchers into an object.
@rwjblue rwjblue merged commit be1d622 into master Jul 24, 2015
@rwjblue rwjblue deleted the abstract-chainwatchers branch July 24, 2015 00:28
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

Successfully merging this pull request may close these issues.

5 participants