From f2d42067b9200b685dff2a4c574aff963107435a Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Sat, 11 Nov 2017 16:05:20 -0500 Subject: [PATCH] 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 --- packages/ddp-client/common/livedata_connection.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/ddp-client/common/livedata_connection.js b/packages/ddp-client/common/livedata_connection.js index 0a2bd69e04..a1f7b147e9 100644 --- a/packages/ddp-client/common/livedata_connection.js +++ b/packages/ddp-client/common/livedata_connection.js @@ -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,