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 upImplement [Unforgeable] #7988
Implement [Unforgeable] #7988
Conversation
highfive
commented
Oct 13, 2015
|
|
|
|
|
|
|
r? @Ms2ger |
|
This matches up well with Gecko's implementation. I'm happy with it! Reviewed 9 of 9 files at r1. components/script/dom/bindings/codegen/CodegenRust.py, line 2214 [r1] (raw file): Comments from the review on Reviewable.io |
|
That being said, I'd like to have a test for overwriting an unforgeable property as well as unforgeable properties on proxies. |
|
Here's one from gecko we can steal: http://mxr.mozilla.org/mozilla-central/source/dom/bindings/test/test_unforgeablesonexpando.html?force=1 |
|
I added a test. The failing one is unrelated to unforgeable attributes but I included it nonetheless. -S-needs-rebase Review status: 2 of 9 files reviewed at latest revision, 1 unresolved discussion. components/script/dom/bindings/codegen/CodegenRust.py, line 2214 [r1] (raw file): Comments from the review on Reviewable.io |
|
I amended the patch with the test expectations. |
|
This can merge with the requested comment addition. Reviewed 8 of 8 files at r3. components/script/dom/bindings/codegen/CodegenRust.py, line 4706 [r3] (raw file): Comments from the review on Reviewable.io |
This is mostly stolen from Gecko. As there, we define the unforgeable members on an object stored in the slots of the prototype object. They are then copied onto instance objects when they are instantiated. It should be noted that proxy objects see their unforgeable memebers defined on their expando object. Unforgeable attributes aren't properly inherited in codegen (in a similar fashion as getters and setters as filed in #5875) and require to be redefined in derived interfaces. Fortunately, there are currently no such interfaces. No unforgeable members can be included into the TestBinding interfaces for good measure because they are not compatible with setters. Given the unforgeable holder object has the same prototype as actual instances of the interface, the finalize hook needs to check its slot pointer for nullity before dropping it. The new failing test isn't related to Unforgeable attributes, but to the fact that all Document instances currently have a Location, even if their window isn't in a browsing context.
|
Comment added. @bors-servo r=jdm |
|
|
Implement [Unforgeable] This is mostly stolen from Gecko. As there, we define the unforgeable members on an object stored in the slots of the prototype object. They are then copied onto instance objects when they are instantiated. It should be noted that proxy objects see their unforgeable memebers defined on their expando object. Unforgeable attributes aren't properly inherited in codegen (in a similar fashion as getters and setters as filed in #5875) and require to be redefined in derived interfaces. Fortunately, there are currently no such interfaces. No unforgeable members can be included into the TestBinding interfaces for good measure because they are not compatible with setters. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7988) <!-- Reviewable:end -->
|
|
|
|
@bors-servo retry |
Implement [Unforgeable] This is mostly stolen from Gecko. As there, we define the unforgeable members on an object stored in the slots of the prototype object. They are then copied onto instance objects when they are instantiated. It should be noted that proxy objects see their unforgeable memebers defined on their expando object. Unforgeable attributes aren't properly inherited in codegen (in a similar fashion as getters and setters as filed in #5875) and require to be redefined in derived interfaces. Fortunately, there are currently no such interfaces. No unforgeable members can be included into the TestBinding interfaces for good measure because they are not compatible with setters. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7988) <!-- Reviewable:end -->
|
|
nox commentedOct 13, 2015
This is mostly stolen from Gecko. As there, we define the unforgeable members
on an object stored in the slots of the prototype object. They are then copied
onto instance objects when they are instantiated. It should be noted that
proxy objects see their unforgeable memebers defined on their expando object.
Unforgeable attributes aren't properly inherited in codegen (in a similar
fashion as getters and setters as filed in #5875) and require to be redefined
in derived interfaces. Fortunately, there are currently no such interfaces.
No unforgeable members can be included into the TestBinding interfaces for good
measure because they are not compatible with setters.