Fix generic native methods to work with extra args (313153, r/sr=mrbkap/shaver).

This commit is contained in:
brendan%mozilla.org 2005-10-20 19:30:44 +00:00
Родитель 4ee1e637be
Коммит 10de8e659f
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -3486,7 +3486,7 @@ js_generic_native_method_dispatcher(JSContext *cx, JSObject *obj,
* the class constructor object, e.g. Array. Then call the corresponding
* prototype native method with our first argument passed as |this|.
*/
memmove(argv - 1, argv, (fs->nargs + 1) * sizeof(jsval));
memmove(argv - 1, argv, JS_MAX(fs->nargs + 1, argc) * sizeof(jsval));
/*
* Follow Function.prototype.apply and .call by using the global object as