Showing the changes to jsarray.c (1 of 1 file). Show all
Unified · Split
| @@ -259,6 +259,7 @@ static int sortcmp(const void *avoid, const void *bvoid) · 258 unmodified lines | |||
| 259 | const js_Value *a = &aslot->v, *b = &bslot->v; | 259 | const js_Value *a = &aslot->v, *b = &bslot->v; |
| 260 | js_State *J = aslot->J; | 260 | js_State *J = aslot->J; |
| 261 | const char *sx, *sy; | 261 | const char *sx, *sy; |
| 262 | double v; | ||
| 262 | int c; | 263 | int c; |
| 263 | 264 | ||
| 264 | int unx = (a->type == JS_TUNDEFINED); | 265 | int unx = (a->type == JS_TUNDEFINED); |
| @@ -272,7 +273,8 @@ static int sortcmp(const void *avoid, const void *bvoid) · 7 unmodified lines | |||
| 272 | js_pushvalue(J, *a); | 273 | js_pushvalue(J, *a); |
| 273 | js_pushvalue(J, *b); | 274 | js_pushvalue(J, *b); |
| 274 | js_call(J, 2); | 275 | js_call(J, 2); |
| 275 | c = js_tonumber(J, -1); | 276 | v = js_tonumber(J, -1); |
| 277 | c = (v == 0) ? 0 : (v < 0) ? -1 : 1; | ||
| 276 | js_pop(J, 1); | 278 | js_pop(J, 1); |
| 277 | } else { | 279 | } else { |
| 278 | js_pushvalue(J, *a); | 280 | js_pushvalue(J, *a); |