Skip to content
This repository was archived by the owner on Sep 19, 2018. It is now read-only.

Commit e7a80b1

Browse files
aygzcorpan
authored andcommitted
Support typedefs in idlharness
1 parent acae62d commit e7a80b1

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

idlharness.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,11 @@ IdlArray.prototype.test = function()
437437
IdlArray.prototype.assert_type_is = function(value, type)
438438
//@{
439439
{
440+
if (type.idlType in this.members
441+
&& this.members[type.idlType] instanceof IdlTypedef) {
442+
this.assert_type_is(value, this.members[type.idlType].idlType);
443+
return;
444+
}
440445
if (type.union) {
441446
for (var i = 0; i < type.idlType.length; i++) {
442447
try {
@@ -644,10 +649,6 @@ IdlArray.prototype.assert_type_is = function(value, type)
644649
{
645650
// TODO: Test when we actually have something to test this on
646651
}
647-
else if (this.members[type] instanceof IdlTypedef)
648-
{
649-
// TODO: Test when we actually have something to test this on
650-
}
651652
else
652653
{
653654
throw "Type " + type + " isn't an interface or dictionary";
@@ -2023,8 +2024,8 @@ function IdlTypedef(obj)
20232024
/** Self-explanatory. */
20242025
this.name = obj.name;
20252026

2026-
/** An array of values produced by the "typedef" production. */
2027-
this.values = obj.values;
2027+
/** The idlType that we are supposed to be typedeffing to. */
2028+
this.idlType = obj.idlType;
20282029

20292030
}
20302031
//@}

0 commit comments

Comments
 (0)