Skip to content

Fix membership assignment for old-fashioned prototype members #599

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

Merged
merged 1 commit into from
Nov 16, 2016

Conversation

tmcw
Copy link
Member

@tmcw tmcw commented Nov 15, 2016

Fixes #598 by finding the membership chain of prototype members of traditional classes assigned with var and member assignments. cc @arv for the review

This changes behavior: previously in the case of

/** base */
var Foo = function Bar() {
  {
    /** */
    this.baz = 0;
  }
};

We assigned baz to Bar. Now we will assign Baz to Foo. I believe this is
right, since in JavaScript Bar is not actually bound in this code. The new behavior also matches JSDoc's behavior.

Fixes #598

This _changes behavior_: previously in the case of

```js
/** base */
var Foo = function Bar() {
  {
    /** */
    this.baz = 0;
  }
};
```

We assigned baz to Bar. Now we will assign Baz to Foo. I believe this is
right, since in JavaScript Bar is not actually bound in this code.
@tmcw tmcw merged commit 1c48a4f into master Nov 16, 2016
@tmcw tmcw deleted the members-only branch November 16, 2016 16:33
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.

1 participant