mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update web-platform-tests to revision bc60e6f82132cfc9a5b688c566c7772024b3c15c
This commit is contained in:
parent
449881f566
commit
29156ca9e2
223 changed files with 7517 additions and 2093 deletions
|
@ -251,6 +251,15 @@ IdlArray.prototype.add_dependency_idls = function(raw_idls, options)
|
|||
this.includes[k].forEach(v => all_deps.add(v));
|
||||
});
|
||||
this.partials.forEach(p => all_deps.add(p.name));
|
||||
// Add 'TypeOfType' for each "typedef TypeOfType MyType;" entry.
|
||||
Object.entries(this.members).forEach(([k, v]) => {
|
||||
if (v instanceof IdlTypedef) {
|
||||
let defs = v.idlType.union
|
||||
? v.idlType.idlType.map(t => t.idlType)
|
||||
: [v.idlType.idlType];
|
||||
defs.forEach(d => all_deps.add(d));
|
||||
}
|
||||
});
|
||||
|
||||
// Add the attribute idlTypes of all the nested members of idls.
|
||||
const attrDeps = parsedIdls => {
|
||||
|
@ -488,8 +497,7 @@ IdlArray.prototype.internal_add_idls = function(parsed_idls, options)
|
|||
break;
|
||||
|
||||
case "callback":
|
||||
// TODO
|
||||
console.log("callback not yet supported");
|
||||
this.members[parsed_idl.name] = new IdlCallback(parsed_idl);
|
||||
break;
|
||||
|
||||
case "enum":
|
||||
|
@ -1163,9 +1171,13 @@ IdlArray.prototype.assert_type_is = function(value, type)
|
|||
{
|
||||
// TODO: Test when we actually have something to test this on
|
||||
}
|
||||
else if (this.members[type] instanceof IdlCallback)
|
||||
{
|
||||
assert_equals(typeof value, "function");
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IdlHarnessError("Type " + type + " isn't an interface or dictionary");
|
||||
throw new IdlHarnessError("Type " + type + " isn't an interface, callback or dictionary");
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -3096,6 +3108,24 @@ function IdlEnum(obj)
|
|||
|
||||
IdlEnum.prototype = Object.create(IdlObject.prototype);
|
||||
|
||||
/// IdlCallback ///
|
||||
// Used for IdlArray.prototype.assert_type_is
|
||||
function IdlCallback(obj)
|
||||
{
|
||||
/**
|
||||
* obj is an object produced by the WebIDLParser.js "callback"
|
||||
* production.
|
||||
*/
|
||||
|
||||
/** Self-explanatory. */
|
||||
this.name = obj.name;
|
||||
|
||||
/** Arguments for the callback. */
|
||||
this.arguments = obj.arguments;
|
||||
}
|
||||
|
||||
IdlCallback.prototype = Object.create(IdlObject.prototype);
|
||||
|
||||
/// IdlTypedef ///
|
||||
// Used for IdlArray.prototype.assert_type_is
|
||||
function IdlTypedef(obj)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue