mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 21:27:44 +00:00
LibWeb: Replace IDL 'void' return type with 'undefined'
From the Web IDL spec: https://heycam.github.io/webidl/#idl-undefined [...] undefined constant values in IDL are represented with the `undefined` token. [...] Note: This value was previously spelled `void`, and more limited in how it was allowed to be used.
This commit is contained in:
parent
c1dfb2d883
commit
5d77a19af5
6 changed files with 23 additions and 23 deletions
|
@ -741,7 +741,7 @@ static @fully_qualified_name@* impl_from(JS::VM& vm, JS::GlobalObject& global_ob
|
||||||
auto scoped_generator = generator.fork();
|
auto scoped_generator = generator.fork();
|
||||||
scoped_generator.set("return_type", return_type.name);
|
scoped_generator.set("return_type", return_type.name);
|
||||||
|
|
||||||
if (return_type.name == "void") {
|
if (return_type.name == "undefined") {
|
||||||
scoped_generator.append(R"~~~(
|
scoped_generator.append(R"~~~(
|
||||||
return JS::js_undefined();
|
return JS::js_undefined();
|
||||||
)~~~");
|
)~~~");
|
||||||
|
@ -918,7 +918,7 @@ JS_DEFINE_NATIVE_FUNCTION(@wrapper_class@::@function.name:snakecase@)
|
||||||
|
|
||||||
function_generator.set(".arguments", arguments_builder.string_view());
|
function_generator.set(".arguments", arguments_builder.string_view());
|
||||||
|
|
||||||
if (function.return_type.name != "void") {
|
if (function.return_type.name != "undefined") {
|
||||||
function_generator.append(R"~~~(
|
function_generator.append(R"~~~(
|
||||||
auto retval = impl->@function.name:snakecase@(@.arguments@);
|
auto retval = impl->@function.name:snakecase@(@.arguments@);
|
||||||
)~~~");
|
)~~~");
|
||||||
|
|
|
@ -3,7 +3,7 @@ interface Element : Node {
|
||||||
readonly attribute DOMString tagName;
|
readonly attribute DOMString tagName;
|
||||||
|
|
||||||
DOMString? getAttribute(DOMString qualifiedName);
|
DOMString? getAttribute(DOMString qualifiedName);
|
||||||
void setAttribute(DOMString qualifiedName, DOMString value);
|
undefined setAttribute(DOMString qualifiedName, DOMString value);
|
||||||
|
|
||||||
readonly attribute Element? firstElementChild;
|
readonly attribute Element? firstElementChild;
|
||||||
readonly attribute Element? lastElementChild;
|
readonly attribute Element? lastElementChild;
|
||||||
|
|
|
@ -7,14 +7,14 @@ interface Event {
|
||||||
|
|
||||||
readonly attribute unsigned short eventPhase;
|
readonly attribute unsigned short eventPhase;
|
||||||
|
|
||||||
void stopPropagation();
|
undefined stopPropagation();
|
||||||
attribute boolean cancelBubble;
|
attribute boolean cancelBubble;
|
||||||
void stopImmediatePropagation();
|
undefined stopImmediatePropagation();
|
||||||
|
|
||||||
readonly attribute boolean bubbles;
|
readonly attribute boolean bubbles;
|
||||||
readonly attribute boolean cancelable;
|
readonly attribute boolean cancelable;
|
||||||
attribute boolean returnValue;
|
attribute boolean returnValue;
|
||||||
void preventDefault();
|
undefined preventDefault();
|
||||||
readonly attribute boolean defaultPrevented;
|
readonly attribute boolean defaultPrevented;
|
||||||
readonly attribute boolean composed;
|
readonly attribute boolean composed;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
interface EventTarget {
|
interface EventTarget {
|
||||||
|
|
||||||
void addEventListener(DOMString type, EventListener? callback);
|
undefined addEventListener(DOMString type, EventListener? callback);
|
||||||
void removeEventListener(DOMString type, EventListener? callback);
|
undefined removeEventListener(DOMString type, EventListener? callback);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
interface CanvasRenderingContext2D {
|
interface CanvasRenderingContext2D {
|
||||||
|
|
||||||
void fillRect(double x, double y, double w, double h);
|
undefined fillRect(double x, double y, double w, double h);
|
||||||
void strokeRect(double x, double y, double w, double h);
|
undefined strokeRect(double x, double y, double w, double h);
|
||||||
|
|
||||||
void scale(double x, double y);
|
undefined scale(double x, double y);
|
||||||
void translate(double x, double y);
|
undefined translate(double x, double y);
|
||||||
void rotate(double radians);
|
undefined rotate(double radians);
|
||||||
|
|
||||||
void beginPath();
|
undefined beginPath();
|
||||||
void closePath();
|
undefined closePath();
|
||||||
void fill(DOMString fillRule);
|
undefined fill(DOMString fillRule);
|
||||||
void stroke();
|
undefined stroke();
|
||||||
void moveTo(double x, double y);
|
undefined moveTo(double x, double y);
|
||||||
void lineTo(double x, double y);
|
undefined lineTo(double x, double y);
|
||||||
void quadraticCurveTo(double cpx, double cpy, double x, double y);
|
undefined quadraticCurveTo(double cpx, double cpy, double x, double y);
|
||||||
|
|
||||||
void drawImage(HTMLImageElement image, double dx, double dy);
|
undefined drawImage(HTMLImageElement image, double dx, double dy);
|
||||||
|
|
||||||
attribute DOMString fillStyle;
|
attribute DOMString fillStyle;
|
||||||
attribute DOMString strokeStyle;
|
attribute DOMString strokeStyle;
|
||||||
attribute double lineWidth;
|
attribute double lineWidth;
|
||||||
|
|
||||||
ImageData createImageData(double sw, double sh);
|
ImageData createImageData(double sw, double sh);
|
||||||
void putImageData(ImageData imagedata, double dx, double dy);
|
undefined putImageData(ImageData imagedata, double dx, double dy);
|
||||||
|
|
||||||
readonly attribute HTMLCanvasElement canvas;
|
readonly attribute HTMLCanvasElement canvas;
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,6 @@ interface HTMLFormElement : HTMLElement {
|
||||||
[Reflect=accept-charset] attribute DOMString acceptCharset;
|
[Reflect=accept-charset] attribute DOMString acceptCharset;
|
||||||
[Reflect=novalidate] attribute boolean noValidate;
|
[Reflect=novalidate] attribute boolean noValidate;
|
||||||
|
|
||||||
void submit();
|
undefined submit();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue