Created
February 27, 2013 23:51
-
-
Save syg/5052981 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static JSBool | |
Timeout(JSContext *cx, unsigned argc, jsval *vp) | |
{ | |
if (argc == 0) { | |
JS_SET_RVAL(cx, vp, JS_NumberValue(gTimeoutInterval)); | |
return true; | |
} | |
if (argc > 2) { | |
JS_ReportError(cx, "Wrong number of arguments"); | |
return false; | |
} | |
double t; | |
if (!JS_ValueToNumber(cx, JS_ARGV(cx, vp)[0], &t)) | |
return false; | |
<<<<<<< HEAD | |
if (argc > 1) { | |
RootedValue value(cx, JS_ARGV(cx, vp)[1]); | |
if (!value.isObject() || !value.toObject().isFunction()) { | |
JS_ReportError(cx, "Second argument must be a timeout function"); | |
return false; | |
} | |
gTimeoutFunc = value; | |
} | |
*vp = JSVAL_VOID; | |
||||||| merged common ancestors | |
*vp = JSVAL_VOID; | |
======= | |
if (argc > 1) { | |
RootedValue value(cx, JS_ARGV(cx, vp)[1]); | |
if (!value.isObject() || !value.toObject().isFunction()) { | |
JS_ReportError(cx, "Second argument must be a timeout function"); | |
return false; | |
} | |
gTimeoutFunc = value; | |
} | |
JS_SET_RVAL(cx, vp, UndefinedValue()); | |
>>>>>>> mozilla/master | |
return SetTimeoutValue(cx, t); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment