-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Declare dynamic properties in ext/dom #6644
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
Conversation
6a38dd9
to
4dafb04
Compare
9fd88d4
to
726a1ba
Compare
726a1ba
to
155613d
Compare
155613d
to
58c64b3
Compare
I've just tried to properly declare the dynamic properties. I'm not exactly sure when I should set explicit default values. For now, I only did it for untyped property which are not nullable. |
a8123e5
to
2f2e7aa
Compare
I found the cause of the assertion errors ( Now, only 2 tests fail:
I appreciate any help! |
294fa21
to
063baed
Compare
Now, magically only the
Fortunately, I found some trace: the leak only occurs when the |
The leak should be fixed by 82622d7. |
I think you can elevate all INVALID_STATE_ERR to use strict_error=1 (maybe best as a separate PR). If I understood correctly, this basically corresponds to the usual "uninitialized object" condition, e.g. when you try to create certain DOM objects without going through the DOM API. In line with usual guidelines, it's fine to always throw in that case. |
063baed
to
3a1271c
Compare
Thanks for the fix!
Yes, I think so as well.
I'm happy to do it! I thought that the ship had already sailed for promoting these errors, so I didn't propose this :) I'll provide a separate PR after this one is merged. |
3a1271c
to
c20f2d9
Compare
c20f2d9
to
08c5882
Compare
This one is also fairly ready. @beberlei Do you have time for a longer review? ^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kocsismate I skimmed it and am delighted that it works even though DOM properties are "virtual" and not real, so if all tests pass from me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable, though I haven't checked all the types in detail.
For the read-write cases, we should probably introduce the same type checks we did elsewhere (mysqli/snmp).
Yeah, I want to add this along with the migration to typed properties in a follow-up PR. |
No description provided.