TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

RangeError: Maximum call stack size exceeded

Open magic-akari opened this issue 1 year ago • 0 comments

Bug Report

Originally posted by @clhiker in https://github.com/swc-project/swc/issues/5433

🔎 Search Terms

  • generators
  • JSON.stringify
  • enumerable

🕗 Version & Regression Information

  • This is a crash on runtime

⏯ Playground Link

Playground link with relevant code

💻 Code

let v1 = {
    a: { id: 1 },
    b: []
};
function* v2(v1) {
    try {
    } catch (v1) {
    }
}
const v3 = JSON.stringify(v1, v2);

🙁 Actual behavior

It crashes on runtime.

🙂 Expected behavior

run without crash. and v3 === {}

magic-akari avatar Aug 10 '22 18:08 magic-akari