mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
LibWeb: Support alert() with no arguments
No idea why someone would use that though.
This commit is contained in:
parent
640a24dce8
commit
9eb9b46640
1 changed files with 4 additions and 4 deletions
|
@ -89,10 +89,10 @@ JS::Value WindowObject::alert(JS::Interpreter& interpreter)
|
||||||
auto* impl = impl_from(interpreter);
|
auto* impl = impl_from(interpreter);
|
||||||
if (!impl)
|
if (!impl)
|
||||||
return {};
|
return {};
|
||||||
auto& arguments = interpreter.call_frame().arguments;
|
String message = "";
|
||||||
if (arguments.size() < 1)
|
if (interpreter.argument_count())
|
||||||
return {};
|
message = interpreter.argument(0).to_string();
|
||||||
impl->alert(arguments[0].to_string());
|
impl->alert(message);
|
||||||
return JS::js_undefined();
|
return JS::js_undefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue