Skip to content

Support sequences of sequences in generated bindings. - #12541

Merged
bors-servo merged 1 commit into
servo:masterfrom
jdm:seqseq
Jul 21, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
jdm:seqseq

Conversation

@jdm

@jdm jdm commented Jul 21, 2016 •

Copy link
Copy Markdown
Member

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.



This change is Reviewable

@highfive

Copy link
Copy Markdown

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
Copy Markdown

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 21, 2016
@nox nox added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jul 21, 2016
@nox

nox commented Jul 21, 2016

Copy link
Copy Markdown
Contributor

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.
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Jul 21, 2016
@jdm

jdm commented Jul 21, 2016

Copy link
Copy Markdown
Member Author

@bors-servo: r=nox

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 9ef848b has been approved by nox

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jul 21, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 9ef848b with merge 4ae0897...

bors-servo pushed 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
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev

@bors-servo
bors-servo merged commit 9ef848b into servo:master Jul 21, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sequence<sequence<long>> isn't supported as an argument

4 participants