(item Value, buf *StringBuilder)
| 251 | } |
| 252 | |
| 253 | func (r *Runtime) writeItemLocaleString(item Value, buf *StringBuilder) { |
| 254 | if item != nil && item != _undefined && item != _null { |
| 255 | if f, ok := r.getVStr(item, "toLocaleString").(*Object); ok { |
| 256 | if c, ok := f.self.assertCallable(); ok { |
| 257 | strVal := c(FunctionCall{ |
| 258 | This: item, |
| 259 | }) |
| 260 | buf.WriteString(strVal.toString()) |
| 261 | return |
| 262 | } |
| 263 | } |
| 264 | r.typeErrorResult(true, "Property 'toLocaleString' of object %s is not a function", item) |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | func (r *Runtime) arrayproto_toLocaleString(call FunctionCall) Value { |
| 269 | array := call.This.ToObject(r) |
no test coverage detected