diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2017-03-23 14:57:43 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2017-03-23 14:57:43 +0000 |
commit | 34dec2b5d40f6d476a1017862916ad46ef697ecc (patch) | |
tree | 790883ca14bf9ec1d4c6b8d83041abd08ab4d9c4 /content/handlers/javascript/duktape/Window.bnd | |
parent | 6bfc8ba547698e81dd33f0fdaff29bb227906d8d (diff) | |
parent | c98fc7999aede01b037cfd06ea2dd1d0775b69bb (diff) | |
download | netsurf-34dec2b5d40f6d476a1017862916ad46ef697ecc.tar.gz netsurf-34dec2b5d40f6d476a1017862916ad46ef697ecc.tar.bz2 |
Merge branch 'tlsa/duktape2'
Diffstat (limited to 'content/handlers/javascript/duktape/Window.bnd')
-rw-r--r-- | content/handlers/javascript/duktape/Window.bnd | 9 |
1 files changed, 3 insertions, 6 deletions
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)); |