Bug 1306170 part 4. Fix idlharness to properly handle FrozenArray return types. r=bkelly

This commit is contained in:
Boris Zbarsky 2017-02-13 16:06:46 -05:00
parent 0de977d491
commit 83b7e32013
3 changed files with 14 additions and 5 deletions

View File

@ -2983,9 +2983,6 @@
[Navigator interface: operation unregisterContentHandler(DOMString,USVString)]
expected: FAIL
[Navigator interface: window.navigator must inherit property "languages" with the proper type (10)]
expected: FAIL
[Navigator interface: window.navigator must inherit property "isProtocolHandlerRegistered" with the proper type (14)]
expected: FAIL

View File

@ -202,7 +202,7 @@ function doTest([untested, tested]) {
AbstractWorker: [],
Worker: [],
SharedWorker: [],
MessageEvent: [],
MessageEvent: ['new MessageEvent("message", { data: 5 })'],
MessageChannel: [],
MessagePort: [],
HTMLAppletElement: ['document.createElement("applet")'],

View File

@ -455,7 +455,7 @@ IdlArray.prototype.assert_type_is = function(value, type)
// Nothing we can do.
return;
}
this.assert_type_is(value[0], type.idlType.idlType);
this.assert_type_is(value[0], type.idlType);
return;
}
@ -467,6 +467,18 @@ IdlArray.prototype.assert_type_is = function(value, type)
return;
}
if (type.generic === "FrozenArray") {
assert_true(Array.isArray(value), "Value should be array");
assert_true(Object.isFrozen(value), "Value should be frozen");
if (!value.length)
{
// Nothing we can do.
return;
}
this.assert_type_is(value[0], type.idlType);
return;
}
type = type.idlType;
switch(type)