section 15.4.4.2 Array.prototype.toString()
| 147 | |
| 148 | // section 15.4.4.2 Array.prototype.toString() |
| 149 | JSVal ArrayToString(const Arguments& args, Error* e) { |
| 150 | IV_LV5_CONSTRUCTOR_CHECK("Array.prototype.toString", args, e); |
| 151 | JSObject* const obj = |
| 152 | args.this_binding().ToObject(args.ctx(), IV_LV5_ERROR(e)); |
| 153 | const JSVal join = obj->Get(args.ctx(), symbol::join(), IV_LV5_ERROR(e)); |
| 154 | if (join.IsCallable()) { |
| 155 | ScopedArguments a(args.ctx(), 0, IV_LV5_ERROR(e)); |
| 156 | return static_cast<JSFunction*>(join.object())->Call(&a, obj, e); |
| 157 | } else { |
| 158 | ScopedArguments a(args.ctx(), 0, IV_LV5_ERROR(e)); |
| 159 | a.set_this_binding(obj); |
| 160 | return ObjectToString(a, e); |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | // section 15.4.4.3 Array.prototype.toLocaleString() |
| 165 | JSVal ArrayToLocaleString(const Arguments& args, Error* e) { |
nothing calls this directly
no test coverage detected