Auto merge of #11155 - emilio:codegen-dict-keyword, r=Ms2ger

codegen: Fix dictionary handling and semantics

Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data:
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #11152 (github issue number if applicable).

Either:
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process.

Fixes #11152

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11155)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-05-13 02:47:08 -07:00
commit 221db56b08
11 changed files with 183 additions and 21 deletions

View file

@ -6064,6 +6064,12 @@
"url": "/_mozilla/mozilla/bad_cert_detected.html"
}
],
"mozilla/binding_keyword.html": [
{
"path": "mozilla/binding_keyword.html",
"url": "/_mozilla/mozilla/binding_keyword.html"
}
],
"mozilla/blob.html": [
{
"path": "mozilla/blob.html",

View file

@ -0,0 +1,3 @@
[binding_keyword.html]
type: testharness
prefs: [dom.testbinding.enabled:true]

View file

@ -0,0 +1,17 @@
<!doctype html>
<meta charset="utf-8">
<title>Test for conversions from and to dictionary properties with keywords</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(function() {
var t = new TestBinding();
var dict = t.receiveTestDictionaryWithSuccessOnKeyword();
assert_equals(dict.type, "success");
assert_equals(dict.nonRequiredNullable, undefined);
assert_equals(dict.nonRequiredNullable2, null);
assert_true(t.dictMatchesPassedValues(dict));
}, "Conversion of dictionary elements with rust keywords, and null non-required nullable properties works")
</script>