Fix bug in which leaving the JS version as JSVERSION_DEFAULT would return

all enumerated property names as strings, as was the case in JS1.1, instead
of the modern (>=JS1.2) behavior of allowing either string or integer property
names.
This commit is contained in:
fur 1998-06-24 05:36:46 +00:00
Родитель 9419e27a89
Коммит 107042b6e2
1 изменённых файлов: 2 добавлений и 1 удалений

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

@ -1312,7 +1312,8 @@ js_Interpret(JSContext *cx, jsval *result)
/* Make sure rval is a string for uniformity and compatibility. */
if (!JSVAL_IS_INT(rval)) {
rval = ATOM_KEY((JSAtom *)rval);
} else if (cx->version < JSVERSION_1_2) {
} else if ((cx->version <= JSVERSION_1_1) &&
(cx->version >= JSVERSION_1_0)) {
str = js_NumberToString(cx, (jsdouble) JSVAL_TO_INT(rval));
if (!str) {
ok = JS_FALSE;