(keys, ctx, value, recurseTimes)
| 2267 | } |
| 2268 | |
| 2269 | function formatNamespaceObject(keys, ctx, value, recurseTimes) { |
| 2270 | const output = new Array(keys.length); |
| 2271 | for (let i = 0; i < keys.length; i++) { |
| 2272 | try { |
| 2273 | output[i] = formatProperty(ctx, value, recurseTimes, keys[i], |
| 2274 | kObjectType); |
| 2275 | } catch (err) { |
| 2276 | assert(isNativeError(err) && err.name === 'ReferenceError'); |
| 2277 | // Use the existing functionality. This makes sure the indentation and |
| 2278 | // line breaks are always correct. Otherwise it is very difficult to keep |
| 2279 | // this aligned, even though this is a hacky way of dealing with this. |
| 2280 | const tmp = { [keys[i]]: '' }; |
| 2281 | output[i] = formatProperty(ctx, tmp, recurseTimes, keys[i], kObjectType); |
| 2282 | const pos = StringPrototypeLastIndexOf(output[i], ' '); |
| 2283 | // We have to find the last whitespace and have to replace that value as |
| 2284 | // it will be visualized as a regular string. |
| 2285 | output[i] = StringPrototypeSlice(output[i], 0, pos + 1) + |
| 2286 | ctx.stylize('<uninitialized>', 'special'); |
| 2287 | } |
| 2288 | } |
| 2289 | // Reset the keys to an empty array. This prevents duplicated inspection. |
| 2290 | keys.length = 0; |
| 2291 | return output; |
| 2292 | } |
| 2293 | |
| 2294 | // The array is sparse and/or has extra keys |
| 2295 | function formatSpecialArray(ctx, value, recurseTimes, maxLength, output, i) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…