| OLD | NEW |
| 1 /* | 1 /* |
| 2 Distributed under both the W3C Test Suite License [1] and the W3C | 2 Distributed under both the W3C Test Suite License [1] and the W3C |
| 3 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the | 3 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the |
| 4 policies and contribution forms [3]. | 4 policies and contribution forms [3]. |
| 5 | 5 |
| 6 [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license | 6 [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license |
| 7 [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license | 7 [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license |
| 8 [3] http://www.w3.org/2004/10/27-testcases | 8 [3] http://www.w3.org/2004/10/27-testcases |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 assert_true(Array.isArray(value), "is not array"); | 440 assert_true(Array.isArray(value), "is not array"); |
| 441 if (!value.length) | 441 if (!value.length) |
| 442 { | 442 { |
| 443 // Nothing we can do. | 443 // Nothing we can do. |
| 444 return; | 444 return; |
| 445 } | 445 } |
| 446 this.assert_type_is(value[0], type.idlType.idlType); | 446 this.assert_type_is(value[0], type.idlType.idlType); |
| 447 return; | 447 return; |
| 448 } | 448 } |
| 449 | 449 |
| 450 if (type.generic === "Promise") { |
| 451 assert_own_property(value, "then", "Attribute with a Promise type has a
then property"); |
| 452 // TODO: Ideally, we would check on project fulfillment |
| 453 // that we get the right type |
| 454 // but that would require making the type check async |
| 455 return; |
| 456 } |
| 457 |
| 450 type = type.idlType; | 458 type = type.idlType; |
| 451 | 459 |
| 452 switch(type) | 460 switch(type) |
| 453 { | 461 { |
| 454 case "void": | 462 case "void": |
| 455 assert_equals(value, undefined); | 463 assert_equals(value, undefined); |
| 456 return; | 464 return; |
| 457 | 465 |
| 458 case "boolean": | 466 case "boolean": |
| 459 assert_equals(typeof value, "boolean"); | 467 assert_equals(typeof value, "boolean"); |
| (...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1844 /** An array of values produced by the "typedef" production. */ | 1852 /** An array of values produced by the "typedef" production. */ |
| 1845 this.values = obj.values; | 1853 this.values = obj.values; |
| 1846 | 1854 |
| 1847 } | 1855 } |
| 1848 //@} | 1856 //@} |
| 1849 | 1857 |
| 1850 IdlTypedef.prototype = Object.create(IdlObject.prototype); | 1858 IdlTypedef.prototype = Object.create(IdlObject.prototype); |
| 1851 | 1859 |
| 1852 }()); | 1860 }()); |
| 1853 // vim: set expandtab shiftwidth=4 tabstop=4 foldmarker=@{,@} foldmethod=marker: | 1861 // vim: set expandtab shiftwidth=4 tabstop=4 foldmarker=@{,@} foldmethod=marker: |
| OLD | NEW |