History

Fix error in Array.prototype.toString().

Tor Andersson committed 5 years ago

Commit c3715ce1 parent 6625d1e1 file · +4 −2Browse files

Unified · Split

jsarray.c+4−2
@@ -427,14 +427,16 @@ static void Ap_toString(js_State *J) · 426 unmodified lines
427 js_typeerror(J, "'this' is not an object");427 js_typeerror(J, "'this' is not an object");
428 js_getproperty(J, 0, "join");428 js_getproperty(J, 0, "join");
429 if (!js_iscallable(J, -1)) {429 if (!js_iscallable(J, -1)) {
430 // TODO: call Object.prototype.toString implementation; not via Object.toString JS objects430 js_pop(J, 1);
431 // TODO: call Object.prototype.toString implementation directly
431 js_getglobal(J, "Object");432 js_getglobal(J, "Object");
433 js_getproperty(J, -1, "prototype");
434 js_rot2pop1(J);
432 js_getproperty(J, -1, "toString");435 js_getproperty(J, -1, "toString");
433 js_rot2pop1(J);436 js_rot2pop1(J);
434 }437 }
435 js_copy(J, 0);438 js_copy(J, 0);
436 js_call(J, 0);439 js_call(J, 0);
437 js_pop(J, 1);
438}440}
439 441
440static void Ap_indexOf(js_State *J)442static void Ap_indexOf(js_State *J)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t