I'm currently developing a dart interop wrapper (using https://pub.dev/packages/node_interop). While I was able to handle most nodejs API from tablestore, some issue remain in how some arrays are handled. For example in encode.js, we have currently
for (var pk in params.tables[i].primaryKey) {
item.primaryKey.push(TableStore.PlainBufferBuilder.serializePrimaryKey(params.tables[i].primaryKey[pk]));
}
for (var k = 0; k < params.tables[i].primaryKey.length; k++) {
item.primaryKey.push(TableStore.PlainBufferBuilder.serializePrimaryKey(params.tables[i].primaryKey[k]));
}
This seems to be done (at least) in 3 places in encoder.js:
I'm currently developing a dart interop wrapper (using https://pub.dev/packages/node_interop). While I was able to handle most nodejs API from tablestore, some issue remain in how some arrays are handled. For example in encode.js, we have currently
This is not the recommended way to iterate over an array. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...inhttps://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Instructions/for...in. This is also causing an issue with dart adding hidden properties.
Something like this is preferable:
This seems to be done (at least) in 3 places in encoder.js:
Would you consider changing this? Thanks!