pvorb / clone

deeply clone arbitrary objects in javascript
https://www.npmjs.com/package/clone
MIT License
781 stars 130 forks source link

var a={};a.b=a;clone(a);这种循环引用将报错 #107

Closed yangdan8 closed 5 years ago

yangdan8 commented 5 years ago

var a={};a.b=a;clone(a);这种循环引用将报错

pvorb commented 5 years ago

Translation from Google:

This circular reference will give an error

pvorb commented 5 years ago

It doesn't give an error for me:

$ node
> var clone = require('clone');
undefined
> var a={};a.b=a;clone(a);
{ b: [Circular] }

Are you sure you are using this package? And if so, what version are you using?

yangdan8 commented 5 years ago

I saw easytable reference your deepclone infinite loop, it is estimated that this problem, sorry, did not look at the specific logic in detail