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

All interface objects now share the same hasInstance #9633

Merged
merged 1 commit into from Feb 19, 2016

Conversation

@GuillaumeGomez
Copy link
Contributor

GuillaumeGomez commented Feb 14, 2016

r? @nox

Review on Reviewable

#9281

@highfive
Copy link

highfive commented Feb 14, 2016

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@@ -273,22 +278,25 @@ pub unsafe fn has_instance(
}
let mut value = RootedObject::new(cx, value.to_object());

// Steps 2-3 only concern callback interface objects.
let class = JS_GetClass(*prototype.ptr);
if let Ok(object) = get_dom_class(UncheckedUnwrapObject(class, 0)) {

This comment has been minimized.

Copy link
@GuillaumeGomez

GuillaumeGomez Feb 14, 2016

Author Contributor

How do you get NonCallbackInterfaceObjectClass instance here?

This comment has been minimized.

Copy link
@nox

nox Feb 14, 2016

Member

&*(&class as *const _ as *const NonCallbackInterfaceObjectClass)

@nox
Copy link
Member

nox commented Feb 14, 2016

Great work, just a few corrections needed.

-S-awaiting-review +S-needs-code-changes


Reviewed 2 of 2 files at r2.
Review status: all files reviewed at latest revision, 15 unresolved discussions.


components/script/dom/bindings/codegen/CodegenRust.py, line 1898 [r2] (raw file):
depth


components/script/dom/bindings/codegen/CodegenRust.py, line 1902 [r2] (raw file):
Everything related to hasInstance should go away from here.


components/script/dom/bindings/codegen/CodegenRust.py, line 4740 [r2] (raw file):
With this patch, this whole class should go away.


components/script/dom/bindings/codegen/CodegenRust.py, line 5363 [r2] (raw file):
No need to import this here, nor has_instance.


components/script/dom/bindings/interface.rs, line 282 [r1] (raw file):
Call these two variables js_class and object_class.


components/script/dom/bindings/interface.rs, line 88 [r2] (raw file):
This type isn't useful anymore and can go away.


components/script/dom/bindings/interface.rs, line 107 [r2] (raw file):
"The prototype ID of that interface, used in the hasInstance hook."


components/script/dom/bindings/interface.rs, line 109 [r2] (raw file):
"The prototype depth of that interface, used in the hasInstance hook."


components/script/dom/bindings/interface.rs, line 110 [r2] (raw file):
proto_depth: u16


components/script/dom/bindings/interface.rs, line 119 [r2] (raw file):
There shouldn't be a variable has_instance parameter anymore, instead class.hasInstance should be set to has_instance_hook.


components/script/dom/bindings/interface.rs, line 122 [r2] (raw file):
proto_depth


components/script/dom/bindings/interface.rs, line 126 [r2] (raw file):
Nit: could you put these two fields after the class one? It weirds me out.


components/script/dom/bindings/interface.rs, line 271 [r2] (raw file):
has_instance_hook, and it doesn't need to be public anymore.
Also nit: please indent the arguments like I did for the other functions in that module.


components/script/dom/bindings/interface.rs, line 286 [r2] (raw file):
No need to be public anymore.


components/script/dom/bindings/interface.rs, line 302 [r2] (raw file):
[object_class.proto_depth as usize]


Comments from the review on Reviewable.io

@nox
Copy link
Member

nox commented Feb 14, 2016

-S-awaiting-review +S-needs-code-changes


Reviewed 2 of 2 files at r3.
Review status: all files reviewed at latest revision, 13 unresolved discussions.


Comments from the review on Reviewable.io

@nox
Copy link
Member

nox commented Feb 14, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Feb 14, 2016

Trying commit 67b5221 with merge 2afd08e...

bors-servo added a commit that referenced this pull request Feb 14, 2016
All interface objects now share the same hasInstance

r? @nox

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9633)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Feb 14, 2016

💔 Test failed - linux-rel

@bors-servo
Copy link
Contributor

bors-servo commented Feb 15, 2016

The latest upstream changes (presumably #9645) made this pull request unmergeable. Please resolve the merge conflicts.

@GuillaumeGomez
Copy link
Contributor Author

GuillaumeGomez commented Feb 15, 2016

Re-updated.

@jdm jdm removed the S-needs-rebase label Feb 15, 2016
@KiChjang
Copy link
Member

KiChjang commented Feb 16, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Feb 16, 2016

Trying commit 857cf87 with merge fd8f228...

bors-servo added a commit that referenced this pull request Feb 16, 2016
All interface objects now share the same hasInstance

r? @nox

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9633)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Feb 16, 2016

💔 Test failed - linux-rel

@KiChjang
Copy link
Member

KiChjang commented Feb 19, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Feb 19, 2016

Testing commit bb9d369 with merge 778230d...

bors-servo added a commit that referenced this pull request Feb 19, 2016
All interface objects now share the same hasInstance

r? @nox

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9633)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Feb 19, 2016

💔 Test failed - linux-rel

@KiChjang
Copy link
Member

KiChjang commented Feb 19, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Feb 19, 2016

Testing commit bb9d369 with merge 691eeb3...

bors-servo added a commit that referenced this pull request Feb 19, 2016
All interface objects now share the same hasInstance

r? @nox

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9633)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Feb 19, 2016

💔 Test failed - mac-rel-wpt

@KiChjang
Copy link
Member

KiChjang commented Feb 19, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Feb 19, 2016

Previous build results for android, gonk, linux-dev, mac-dev-unit, mac-rel-css are reusable. Rebuilding only linux-rel, mac-rel-wpt...

@bors-servo
Copy link
Contributor

bors-servo commented Feb 19, 2016

💔 Test failed - linux-rel

@KiChjang
Copy link
Member

KiChjang commented Feb 19, 2016

@nox nox added S-awaiting-merge and removed S-tests-failed labels Feb 19, 2016
@bors-servo
Copy link
Contributor

bors-servo commented Feb 19, 2016

Testing commit bb9d369 with merge 2676307...

bors-servo added a commit that referenced this pull request Feb 19, 2016
All interface objects now share the same hasInstance

r? @nox

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9633)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Feb 19, 2016

@bors-servo bors-servo merged commit bb9d369 into servo:master Feb 19, 2016
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@GuillaumeGomez GuillaumeGomez deleted the GuillaumeGomez:has_instance branch Feb 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.