Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRename conversion routines, again. #8473
Comments
|
So why would "reflector" refer to JSObject, when we have an actual Rust structure called Reflector and nothing named Object anywhere? We should probably rename again everything, but we need a new term somewhere. |
|
In the documentation you point out, I would rename DOM object to DOM structure, and reflector to object. |
|
CC @bholley |
|
"Object Reflection" is the standard term that I'm aware of for mirroring objects across language runtimes. Of those two words, the "reflect" part is much less ambiguous than the "object" part, which is why "reflector" is a better name than "object". It is unfortunate that Rust has also recently introduced a trait called "Reflect". However, I still think that in there are, in total, several orders of magnitude more meanings of the term "object" than there are of the term "reflector", and that the former would be extremely confusing, especially in the case where a given Rust DOM object holds onto other JS objects in addition to its reflector. |
|
Rust introduced a Reflect trait? |
|
This was news to me too: |
|
FWIW the naming of "Reflectable" rather than "Reflect" was my fault, since I was a rust n00b at the time (several years ago). I sorta figured it would get fixed at some point. |
|
What about global_root_from_reflectable, instead of global_root_from_reflector? |
|
I think I'd prefer renaming |
That sounds reasonable to me. |
Is this change still desired? If so, I can make the change. |
|
Seems ok with me too. |
|
PR opened: #14495. |
Rename `Reflectable` to `DomObject`. Fixes #8473. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14495) <!-- Reviewable:end -->
…xcv:reflectable-domobject); r=jdm Fixes servo/servo#8473. Source-Repo: https://github.com/servo/servo Source-Revision: b192ae9db7082346a4a6a985c5557d4cea75d50e
…xcv:reflectable-domobject); r=jdm Fixes servo/servo#8473. Source-Repo: https://github.com/servo/servo Source-Revision: b192ae9db7082346a4a6a985c5557d4cea75d50e UltraBlame original commit: 81364670e29057d38aeea04189822f8dd45275b6
…xcv:reflectable-domobject); r=jdm Fixes servo/servo#8473. Source-Repo: https://github.com/servo/servo Source-Revision: b192ae9db7082346a4a6a985c5557d4cea75d50e UltraBlame original commit: 81364670e29057d38aeea04189822f8dd45275b6
…xcv:reflectable-domobject); r=jdm Fixes servo/servo#8473. Source-Repo: https://github.com/servo/servo Source-Revision: b192ae9db7082346a4a6a985c5557d4cea75d50e UltraBlame original commit: 81364670e29057d38aeea04189822f8dd45275b6
In b290a31, @nox renamed a bunch of conversion routines in a way that is almost diametrically opposed to the standard terminology we use. In particular, an object that implements
Reflectableis a "DOM object", and aJSObjectfor a DOM object is its "reflector". We should correct these names.