(obj, fn)
| 269 | // cache things in pre-visit order so the references exist |
| 270 | const circularSymbol = Symbol('circular'); |
| 271 | function walk(obj, fn) { |
| 272 | let res = {}; |
| 273 | for (let k in obj) { |
| 274 | res[k] = fn(obj[k], null); |
| 275 | } |
| 276 | |
| 277 | return res; |
| 278 | } |
| 279 | |
| 280 | function recurse(obj, fn) { |
| 281 | if (obj[circularSymbol]) { |