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

Support sequences of sequences in generated bindings. #12541

Merged
merged 1 commit into from Jul 21, 2016
Merged

Conversation

@jdm
Copy link
Member

jdm commented Jul 21, 2016

This fixes a blocker for #11897. unroll recursively gets the inner type of any sequence type encountered, so it's inappropriate for codegen that only wants the immediate inner type. However, if a type identifies as a sequence and is nullable, we need to reach through the nullable wrapper first. Gecko does very similar things.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #12528 (github issue number if applicable).
  • There are tests for these changes

This change is Reviewable

@highfive
Copy link

highfive commented Jul 21, 2016

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/bindings/codegen/CodegenRust.py, components/script/dom/testbinding.rs, components/script/dom/webidls/TestBinding.webidl
@highfive
Copy link

highfive commented Jul 21, 2016

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@nox
Copy link
Member

nox commented Jul 21, 2016

One nit and r=me.

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


Reviewed 3 of 3 files at r1.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


components/script/dom/bindings/codegen/CodegenRust.py, line 716 [r1] (raw file):

    if type.isSequence():
        elementType = type.inner.inner if type.nullable() else type.inner

Could you make a function for this and call it everywhere? Named something like getInnerSequenceType.


Comments from Reviewable

unroll recursively gets the inner type of any sequence type encountered, so it's inappropriate for codegen that only wants the immediate inner type. However, if a type identifies as a sequence and is nullable, we need to reach through the nullable wrapper first. Gecko does very similar things.
@jdm
Copy link
Member Author

jdm commented Jul 21, 2016

@bors-servo: r=nox

@bors-servo
Copy link
Contributor

bors-servo commented Jul 21, 2016

📌 Commit 9ef848b has been approved by nox

@bors-servo
Copy link
Contributor

bors-servo commented Jul 21, 2016

Testing commit 9ef848b with merge 4ae0897...

bors-servo added a commit that referenced this pull request Jul 21, 2016
Support sequences of sequences in generated bindings.

This fixes a blocker for #11897. `unroll` recursively gets the inner type of any sequence type encountered, so it's inappropriate for codegen that only wants the immediate inner type. However, if a type identifies as a sequence and is nullable, we need to reach through the nullable wrapper first. Gecko does very similar things.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12528 (github issue number if applicable).
- [X] There are tests for these changes

<!-- 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/12541)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 21, 2016

@bors-servo bors-servo merged commit 9ef848b into servo:master Jul 21, 2016
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@bors-servo bors-servo mentioned this pull request Jul 21, 2016
4 of 5 tasks complete
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.

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