Change for...in loop to for...of during GC

for...in loop is causing random console error during garbage collection. It breaks the yjs since it is meant for enumeration, not iteration.
This commit is contained in:
yousourceinc 2021-03-31 01:56:26 +08:00 committed by GitHub
parent 03685ac84a
commit b9b81bea50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -505,7 +505,7 @@ module.exports = function (Y/* :any */) {
*/
// ** Now the new implementation starts **
// reset neworigin of all originOf[*]
for (var _i in o.originOf) {
for (var _i of o.originOf) {
var originsIn = yield* this.getOperation(o.originOf[_i])
if (originsIn != null) {
originsIn.origin = neworigin