Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/df496cc8bcbe2e4bc0687fd3e8e678686d37b5cc
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/df496cc8bcbe2e4bc0687fd3e8e678686d37b5cc
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/df496cc8bcbe2e4bc0687fd3e8e678686d37b5cc

The branch, master has been updated
       via  df496cc8bcbe2e4bc0687fd3e8e678686d37b5cc (commit)
      from  9a3f138f9240f2865f5b15a6892da5b7434c2ae7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=df496cc8bcbe2e4bc0687fd3e8e678686d37b5cc
commit df496cc8bcbe2e4bc0687fd3e8e678686d37b5cc
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>

    Window: set{Timeout,Interval}() default delay 10ms
    
    Signed-off-by: Daniel Silverstone <[email protected]>

diff --git a/content/handlers/javascript/duktape/Window.bnd 
b/content/handlers/javascript/duktape/Window.bnd
index e7d45c8..478f92b 100644
--- a/content/handlers/javascript/duktape/Window.bnd
+++ b/content/handlers/javascript/duktape/Window.bnd
@@ -480,13 +480,11 @@ method Window::alert()
 method Window::setTimeout()
 %{
        duk_idx_t argc = duk_get_top(ctx);
-       if (argc < 2) {
-               /* not enough arguments */
-               return duk_error(ctx, DUK_RET_TYPE_ERROR, 
dukky_error_fmt_argument, 2, argc);
+       duk_int_t timeout = 10;
+       if (argc >= 2) {
+               timeout = duk_get_int(ctx, 1);
        }
-
-       /* func, timeout, args... */
-       duk_int_t timeout = duk_get_int(ctx, 1);
+       /* func, [timeout, args...] */
        if (timeout < 10) { timeout = 10; }
        size_t handle = window_alloc_new_callback(ctx, priv, false, 
(int)timeout);
 
@@ -497,13 +495,11 @@ method Window::setTimeout()
 method Window::setInterval()
 %{
        duk_idx_t argc = duk_get_top(ctx);
-       if (argc < 2) {
-               /* not enough arguments */
-               return duk_error(ctx, DUK_RET_TYPE_ERROR, 
dukky_error_fmt_argument, 2, argc);
+       duk_int_t timeout = 10;
+       if (argc >= 2) {
+               timeout = duk_get_int(ctx, 1);
        }
-
-       /* func, timeout, args... */
-       duk_int_t timeout = duk_get_int(ctx, 1);
+       /* func, [timeout, args...] */
        if (timeout < 10) { timeout = 10; }
        size_t handle = window_alloc_new_callback(ctx, priv, true, 
(int)timeout);
 


-----------------------------------------------------------------------

Summary of changes:
 content/handlers/javascript/duktape/Window.bnd |   20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/content/handlers/javascript/duktape/Window.bnd 
b/content/handlers/javascript/duktape/Window.bnd
index e7d45c8..478f92b 100644
--- a/content/handlers/javascript/duktape/Window.bnd
+++ b/content/handlers/javascript/duktape/Window.bnd
@@ -480,13 +480,11 @@ method Window::alert()
 method Window::setTimeout()
 %{
        duk_idx_t argc = duk_get_top(ctx);
-       if (argc < 2) {
-               /* not enough arguments */
-               return duk_error(ctx, DUK_RET_TYPE_ERROR, 
dukky_error_fmt_argument, 2, argc);
+       duk_int_t timeout = 10;
+       if (argc >= 2) {
+               timeout = duk_get_int(ctx, 1);
        }
-
-       /* func, timeout, args... */
-       duk_int_t timeout = duk_get_int(ctx, 1);
+       /* func, [timeout, args...] */
        if (timeout < 10) { timeout = 10; }
        size_t handle = window_alloc_new_callback(ctx, priv, false, 
(int)timeout);
 
@@ -497,13 +495,11 @@ method Window::setTimeout()
 method Window::setInterval()
 %{
        duk_idx_t argc = duk_get_top(ctx);
-       if (argc < 2) {
-               /* not enough arguments */
-               return duk_error(ctx, DUK_RET_TYPE_ERROR, 
dukky_error_fmt_argument, 2, argc);
+       duk_int_t timeout = 10;
+       if (argc >= 2) {
+               timeout = duk_get_int(ctx, 1);
        }
-
-       /* func, timeout, args... */
-       duk_int_t timeout = duk_get_int(ctx, 1);
+       /* func, [timeout, args...] */
        if (timeout < 10) { timeout = 10; }
        size_t handle = window_alloc_new_callback(ctx, priv, true, 
(int)timeout);
 


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to