Skip to content

Instantly share code, notes, and snippets.

@cap10morgan
Created August 28, 2019 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cap10morgan/b9f283fa8035b8c0bc527b0911eed1fb to your computer and use it in GitHub Desktop.
Save cap10morgan/b9f283fa8035b8c0bc527b0911eed1fb to your computer and use it in GitHub Desktop.
Diff between working and non-working JS
--- game_common_pb.js 2019-08-28 11:46:27.000000000 -0600
+++ game_common_strict_pb.js 2019-08-28 11:56:15.000000000 -0600
@@ -10,26 +10,26 @@
var jspb = require('google-protobuf');
var goog = jspb;
-var global = Function('return this')();
+var proto = {};
-goog.exportSymbol('proto.game.ChatMessage', null, global);
-goog.exportSymbol('proto.game.CommandReceived', null, global);
-goog.exportSymbol('proto.game.CommandUpdate', null, global);
-goog.exportSymbol('proto.game.Exit', null, global);
-goog.exportSymbol('proto.game.Location', null, global);
-goog.exportSymbol('proto.game.MessageToUser', null, global);
-goog.exportSymbol('proto.game.OpenPortalMessage', null, global);
-goog.exportSymbol('proto.game.OpenPortalResponseMessage', null, global);
-goog.exportSymbol('proto.game.Player', null, global);
-goog.exportSymbol('proto.game.Portal', null, global);
-goog.exportSymbol('proto.game.RequestObjectTransferMessage', null, global);
-goog.exportSymbol('proto.game.Session', null, global);
-goog.exportSymbol('proto.game.ShoutMessage', null, global);
-goog.exportSymbol('proto.game.Stats', null, global);
-goog.exportSymbol('proto.game.TransferredObjectMessage', null, global);
-goog.exportSymbol('proto.game.UserInput', null, global);
-goog.exportSymbol('proto.game.UserInterfaceMessage', null, global);
-goog.exportSymbol('proto.game.UserInterfaceMessage.UiMessageCase', null, global);
+goog.exportSymbol('game.ChatMessage', null, proto);
+goog.exportSymbol('game.CommandReceived', null, proto);
+goog.exportSymbol('game.CommandUpdate', null, proto);
+goog.exportSymbol('game.Exit', null, proto);
+goog.exportSymbol('game.Location', null, proto);
+goog.exportSymbol('game.MessageToUser', null, proto);
+goog.exportSymbol('game.OpenPortalMessage', null, proto);
+goog.exportSymbol('game.OpenPortalResponseMessage', null, proto);
+goog.exportSymbol('game.Player', null, proto);
+goog.exportSymbol('game.Portal', null, proto);
+goog.exportSymbol('game.RequestObjectTransferMessage', null, proto);
+goog.exportSymbol('game.Session', null, proto);
+goog.exportSymbol('game.ShoutMessage', null, proto);
+goog.exportSymbol('game.Stats', null, proto);
+goog.exportSymbol('game.TransferredObjectMessage', null, proto);
+goog.exportSymbol('game.UserInput', null, proto);
+goog.exportSymbol('game.UserInterfaceMessage', null, proto);
+goog.exportSymbol('game.UserInterfaceMessage.UiMessageCase', null, proto);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
@@ -3559,4 +3559,4 @@
};
-goog.object.extend(exports, proto.game);
+goog.object.extend(exports, proto);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment