Commit 04e48a0f authored by rswindell's avatar rswindell
Browse files

Bugfix: passing an object to JS_ValueToInt32() apparently causes the JS engine

to crash, so test arg (to File.open() with JSVAL_IS_NUMBER() first.
parent 8d5e3b7c
......@@ -149,7 +149,7 @@ js_open(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
mode=JS_GetStringBytes(str);
} else if(JSVAL_IS_BOOLEAN(argv[i])) /* shareable */
shareable=JSVAL_TO_BOOLEAN(argv[i]);
else /* bufsize */
else if(JSVAL_IS_NUMBER(argv[i])) /* bufsize */
JS_ValueToInt32(cx,argv[i],&bufsize);
}
SAFECOPY(p->mode,mode);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment