Browse Source

LibWeb: support confirm() with no arguments

Nick Tiberi 5 years ago
parent
commit
d12f27b58e
1 changed files with 4 additions and 4 deletions
  1. 4 4
      Libraries/LibWeb/Bindings/WindowObject.cpp

+ 4 - 4
Libraries/LibWeb/Bindings/WindowObject.cpp

@@ -108,10 +108,10 @@ JS::Value WindowObject::confirm(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;
-    if (arguments.size() < 1)
-        return {};
-    return JS::Value(impl->confirm(arguments[0].to_string()));
+    String message = "";
+    if (interpreter.argument_count())
+        message = interpreter.argument(0).to_string();
+    return JS::Value(impl->confirm(message));
 }
 }
 
 
 JS::Value WindowObject::set_interval(JS::Interpreter& interpreter)
 JS::Value WindowObject::set_interval(JS::Interpreter& interpreter)