Use Object.keys instead of Object.entries.

It turns out we do not polyfill Object.entries, because that would require
requiring 'core-js/es7/object' in ecmascript-runtime-client/runtime.js.
Something to consider, but not strictly necessary right now.

https://github.com/meteor/meteor/pull/9338#discussion_r150306273
This commit is contained in:
Ben Newman
2017-11-11 16:05:20 -05:00
parent 24e07095d7
commit f2d42067b9

View File

@@ -1678,8 +1678,8 @@ export class Connection {
// Mark all messages as unsent, they have not yet been sent on this
// connection.
Object.entries(this._methodInvokers).forEach(([id, methodInvoker]) => {
methodInvoker.sentMessage = false;
Object.keys(this._methodInvokers).forEach(id => {
this._methodInvokers[id].sentMessage = false;
});
// If an `onReconnect` handler is set, call it first. Go through
@@ -1691,7 +1691,8 @@ export class Connection {
// add new subscriptions at the end. this way they take effect after
// the handlers and we don't see flicker.
Object.entries(this._subscriptions).forEach(([id, sub]) => {
Object.keys(this._subscriptions).forEach(id => {
const sub = this._subscriptions[id];
this._send({
msg: 'sub',
id: id,