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

FIX: Make JsBoundMethod a subclass of JsProxy #1124

Merged
merged 7 commits into from Jan 14, 2021

Conversation

hoodmane
Copy link
Member

@hoodmane hoodmane commented Jan 11, 2021

Fixes #788 (tested in test_nested_attribute_access) and fixes #1123 (tested in test_window_isnt_super_weird_anymore). This also resolves a problem that blocks any fix for #768.

@hoodmane hoodmane changed the title Make JsBoundMethod a subclass of JsProxy BUGFIX: Make JsBoundMethod a subclass of JsProxy Jan 11, 2021
@rth
Copy link
Member

rth commented Jan 13, 2021

This is a very useful, thanks!

If this the fix for #788 why is test_nested_attribute_access passing in #1126 ? Generally there is some diff overlap with that PR: which one should be merged first?

@hoodmane
Copy link
Member Author

hoodmane commented Jan 13, 2021

Ugh yes, there's several closely bound together bugs here. I merged this one into #1126 in order to make the #1126 tests pass (otherwise a bunch of tests fail). Commit 709118c on that branch has everything needed to fix the bug, the stuff on #1126 after that is I merged this, merged master, and messed around with tests.

So merge this one first and then I can merge master on that one and then merge that one? Also I have some tests that will only pass once this, #1126, and #1033 all are merged. I guess I can add them to the last one to merge (if I can remember where I put them...).

I think between this one and #1033 what should happen is that the Vectorcall implementation in #1033 should be moved to JsBoundMethod, the implementation of JsProxy_Vectorcall should be removed so that JsProxy is no longer callable (I don't think it's possible to get a javascript function anymore that isn't a JsBoundMethod) and then rename JsBoundMethod to JsProxy_Callable. (Also the .new method should be moved to a subclass of JsProxy_Callable which I'd call JsProxy_Constructible, but that could happen separately after everything else).

So I think the right order is this, then #1126, then I can update #1033 as described and merge that third.

@hoodmane
Copy link
Member Author

hoodmane commented Jan 13, 2021

Oh yeah #1098 is also blocked on this -- after #1124 and possibly #1126 are merged, the test suite for #1098 should start passing. I guess I'll try merging this on #1098 now and see what happens...

@hoodmane
Copy link
Member Author

Also finishing #972 is blocked on this.

Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

Thanks! Generally LGTM, but I'm not the most relevant reviewer for C code.

Please add a changelog entry.

@rth rth changed the title BUGFIX: Make JsBoundMethod a subclass of JsProxy FIX: Make JsBoundMethod a subclass of JsProxy Jan 14, 2021
@rth rth merged commit 61c56f8 into pyodide:master Jan 14, 2021
@hoodmane hoodmane deleted the subclass-jsboundmethod branch January 14, 2021 16:26
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.

from js import window gives a badly glitched object Nested attribute access in JS->Python type conversion
2 participants