summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/handlers/javascript/duktape/Console.bnd4
-rw-r--r--content/handlers/javascript/duktape/Window.bnd9
-rw-r--r--content/handlers/javascript/duktape/dukky.c3
3 files changed, 6 insertions, 10 deletions
diff --git a/content/handlers/javascript/duktape/Console.bnd b/content/handlers/javascript/duktape/Console.bnd
index 734f0035a..7b4de1ee3 100644
--- a/content/handlers/javascript/duktape/Console.bnd
+++ b/content/handlers/javascript/duktape/Console.bnd
@@ -110,7 +110,7 @@ method Console::time()
return 0;
if (!duk_is_string(ctx, 0)) {
- duk_error(ctx, DUK_ERR_ERROR, "Console.time() takes a string");
+ return duk_error(ctx, DUK_ERR_ERROR, "Console.time() takes a string");
}
duk_set_top(ctx, 1);
@@ -136,7 +136,7 @@ method Console::timeEnd()
return 0;
if (!duk_is_string(ctx, 0)) {
- duk_error(ctx, DUK_ERR_ERROR, "Console.time() takes a string");
+ return duk_error(ctx, DUK_ERR_ERROR, "Console.time() takes a string");
}
duk_set_top(ctx, 1);
diff --git a/content/handlers/javascript/duktape/Window.bnd b/content/handlers/javascript/duktape/Window.bnd
index 489587899..4af8c7aa9 100644
--- a/content/handlers/javascript/duktape/Window.bnd
+++ b/content/handlers/javascript/duktape/Window.bnd
@@ -72,8 +72,7 @@ getter Window::console()
if (duk_is_undefined(ctx, -1)) {
duk_pop(ctx);
if (dukky_create_object(ctx, PROTO_NAME(CONSOLE), 0) != DUK_EXEC_SUCCESS) {
- duk_error(ctx, DUK_ERR_ERROR, "Unable to create console object");
- return 0;
+ return duk_error(ctx, DUK_ERR_ERROR, "Unable to create console object");
}
duk_dup(ctx, -1);
duk_put_prop_string(ctx, -3, MAGIC(Console));
@@ -91,8 +90,7 @@ getter Window::location()
duk_push_pointer(ctx, llcache_handle_get_url(priv->htmlc->base.llcache));
if (dukky_create_object(ctx, PROTO_NAME(LOCATION), 1) != DUK_EXEC_SUCCESS) {
- duk_error(ctx, DUK_ERR_ERROR, "Unable to create location object");
- return 0;
+ return duk_error(ctx, DUK_ERR_ERROR, "Unable to create location object");
}
duk_dup(ctx, -1);
duk_put_prop_string(ctx, -3, MAGIC(Location));
@@ -110,10 +108,9 @@ getter Window::navigator()
if (dukky_create_object(ctx,
PROTO_NAME(NAVIGATOR),
0) != DUK_EXEC_SUCCESS) {
- duk_error(ctx,
+ return duk_error(ctx,
DUK_ERR_ERROR,
"Unable to create navigator object");
- return 0;
}
duk_dup(ctx, -1);
duk_put_prop_string(ctx, -3, MAGIC(Navigator));
diff --git a/content/handlers/javascript/duktape/dukky.c b/content/handlers/javascript/duktape/dukky.c
index 52604f994..dd4378b7a 100644
--- a/content/handlers/javascript/duktape/dukky.c
+++ b/content/handlers/javascript/duktape/dukky.c
@@ -474,8 +474,7 @@ dukky_push_node(duk_context *ctx, struct dom_node *node)
static duk_ret_t
dukky_bad_constructor(duk_context *ctx)
{
- duk_error(ctx, DUK_ERR_ERROR, "Bad constructor");
- return 0;
+ return duk_error(ctx, DUK_ERR_ERROR, "Bad constructor");
}
void