From 78067fc29a89452a08a10d6b907f81e4ce77fbb9 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 31 Oct 2015 09:23:56 +0000 Subject: Log window.alert() messages. --- Docs/UnimplementedJavascript.txt | 1 - javascript/duktape/Window.bnd | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Docs/UnimplementedJavascript.txt b/Docs/UnimplementedJavascript.txt index 7af3f16ea..133b8f554 100644 --- a/Docs/UnimplementedJavascript.txt +++ b/Docs/UnimplementedJavascript.txt @@ -1727,7 +1727,6 @@ getter WheelEvent::deltaX(double);\n getter WheelEvent::deltaY(double);\n getter WheelEvent::deltaZ(double);\n method WheelEvent::initWheelEvent();\n -method Window::alert();\n getter Window::applicationCache(user);\n method Window::atob();\n method Window::blur();\n diff --git a/javascript/duktape/Window.bnd b/javascript/duktape/Window.bnd index a6355fb2c..4d3c0ec7c 100644 --- a/javascript/duktape/Window.bnd +++ b/javascript/duktape/Window.bnd @@ -132,3 +132,11 @@ setter Window::name() browser_window_set_name(priv->win, name); return 0; %} + +method Window::alert() +%{ + duk_size_t msg_len; + const char *msg = duk_safe_to_lstring(ctx, 0, &msg_len); + LOG("JS ALERT: %*s", (int)msg_len, msg); + return 0; +%} -- cgit v1.2.3