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

Allow defineClass to be called more than once with mapInheritance true #48

Merged
merged 2 commits into from
Jun 6, 2012

Conversation

tschaub
Copy link
Contributor

@tschaub tschaub commented Jun 4, 2012

If defineClass is called twice with two classes that share a common superclass, the prototype for the superclass will be created twice. This means that instanceof checks don't work (for the first class defined).

I'm not convinced that the fix in ScriptableObject is in the right pace (there's a whole lot more work going on than necessary in the case of multiple defineClass calls), but it works.

@anba
Copy link
Contributor

anba commented Jun 4, 2012

Maybe buildClassCtor() is a better place to get this working -> anba/rhino@76adbd7 and anba/rhino@fa7e69f

@tschaub
Copy link
Contributor Author

tschaub commented Jun 4, 2012

Thanks @anba. I agree the changes in your DefineClassMapInheritanceBug branch are a better fix. I've attached them to this pull request.

@hns hns merged commit fa7e69f into mozilla:master Jun 6, 2012
@hns
Copy link
Contributor

hns commented Jun 6, 2012

Merged. Thanks!

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.

3 participants