Skip to content

Commit

Permalink
[idlharness.js] Replace void with undefined where it remains (#28539)
Browse files Browse the repository at this point in the history
All uses of void have already been replaced in interfaces/*.idl. This
fixes idlharness.js and replaced void in the few places it remains,
except for the tests in WebIDL/ which aren't run as part of WPT.
  • Loading branch information
foolip committed Apr 16, 2021
1 parent d92cd65 commit 76401f1
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion requestidlecallback/basic.html
Expand Up @@ -19,7 +19,7 @@
assert_equals(typeof window.requestIdleCallback(function() {}), "number");
}, "window.requestIdleCallback() returns a number");

// The cancelIdleCallback method MUST return void
// The cancelIdleCallback method MUST return undefined
test(function() {
assert_equals(typeof window.cancelIdleCallback(1), "undefined");
}, "window.cancelIdleCallback() returns undefined");
Expand Down
2 changes: 1 addition & 1 deletion resources/idlharness.js
Expand Up @@ -1116,7 +1116,7 @@ IdlArray.prototype.assert_type_is = function(value, type)

switch(type)
{
case "void":
case "undefined":
assert_equals(value, undefined);
return;

Expand Down
Expand Up @@ -58,13 +58,13 @@
idlArray.add_idls(`
[Exposed=Window]
namespace foo {
void Truth();
void Lies();
undefined Truth();
undefined Lies();
};
[Exposed=Window]
namespace bar {
[LegacyUnforgeable]
void Truth();
undefined Truth();
};
[Exposed=Window]
namespace baz {
Expand Down
Expand Up @@ -14,7 +14,7 @@
}, "callback interface with a constant");

test(function() {
var i = interfaceFrom("callback interface A { void b(); sequence<any> c(); };");
var i = interfaceFrom("callback interface A { undefined b(); sequence<any> c(); };");
assert_false(i.should_have_interface_object());
}, "callback interface without a constant");

Expand Down
Expand Up @@ -18,7 +18,7 @@
}, 'should return false when member is an attribute.');

test(function() {
var m = memberFrom("static void foo()");
var m = memberFrom("static undefined foo()");
assert_false(m.is_to_json_regular_operation());
}, 'should return false when member is a static operation.');

Expand Down
2 changes: 1 addition & 1 deletion resources/test/tests/unit/IdlInterfaceMember/toString.html
Expand Up @@ -27,7 +27,7 @@
];
for (const [input, output] of tests) {
test(function() {
var m = memberFrom(`void foo(${input})`);
var m = memberFrom(`undefined foo(${input})`);
assert_equals(m.toString(), `foo(${output})`);
}, `toString for ${input}`);
}
Expand Down
8 changes: 4 additions & 4 deletions webvr/idlharness.https.html
Expand Up @@ -83,20 +83,20 @@
* Passing the value returned by `requestAnimationFrame` to
* `cancelAnimationFrame` will unregister the callback.
*/
void cancelAnimationFrame(long handle);
undefined cancelAnimationFrame(long handle);

/**
* Begin presenting to the VRDisplay. Must be called in response to a user gesture.
* Repeat calls while already presenting will update the layers being displayed.
* If the number of values in the leftBounds/rightBounds arrays is not 0 or 4 for any of the passed layers the promise is rejected
* If the source of any of the layers is not present (null), the promise is rejected.
*/
Promise<void> requestPresent(sequence<VRLayerInit> layers);
Promise<undefined> requestPresent(sequence<VRLayerInit> layers);

/**
* Stops presenting to the VRDisplay.
*/
Promise<void> exitPresent();
Promise<undefined> exitPresent();

/**
* Get the layers currently being presented.
Expand All @@ -109,7 +109,7 @@
* canvas as any other operation that uses its source image, and canvases
* created without preserveDrawingBuffer set to true will be cleared.
*/
void submitFrame();
undefined submitFrame();
};

typedef (HTMLCanvasElement or
Expand Down

0 comments on commit 76401f1

Please sign in to comment.