MCPcopy Create free account
hub / github.com/Constellation/iv / ArrayToString

Function ArrayToString

iv/lv5/runtime/array.cc:149–162  ·  view source on GitHub ↗

section 15.4.4.2 Array.prototype.toString()

Source from the content-addressed store, hash-verified

147
148// section 15.4.4.2 Array.prototype.toString()
149JSVal 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()
165JSVal ArrayToLocaleString(const Arguments& args, Error* e) {

Callers

nothing calls this directly

Calls 9

ObjectToStringFunction · 0.85
ToObjectMethod · 0.80
objectMethod · 0.80
this_bindingMethod · 0.45
ctxMethod · 0.45
GetMethod · 0.45
IsCallableMethod · 0.45
CallMethod · 0.45
set_this_bindingMethod · 0.45

Tested by

no test coverage detected