minecraft-debugger
minecraft-debugger copied to clipboard
Object.entries(object).forEach breaks the debugger
code
const object = { help: 8, heloo: 9, hejkekj: 8 };
Object.entries(object).forEach(([key, value]) => {
console.warn(JSON.stringify({ [key]: value }));
});
error: Failed to get stack trace for undefined at line undefined.
in-game the code works fine
this bug also occurs on any array methods with callbacks
code to test:
const array = [0, 1, 2, 3]; // Set breakpoint here
array.map((el) => {
if (typeof el === "number") return el;
});
array.filter((e) => typeof e === "number");
array.forEach((e) => {
e++;
});
array.find((e) => {
if (e.toFixed) return e;
});
debugger console output:
vscode error popup:
What's weird is callbacks in custom functions (prototypes) do not throw but only native array ones.