aboutsummaryrefslogtreecommitdiff
path: root/js/message.js
diff options
context:
space:
mode:
authorHao Nguyen <haon@google.com>2019-04-09 06:23:32 -0700
committerHao Nguyen <haon@google.com>2019-04-09 06:23:32 -0700
commit176f7db11d8242b36a3ea6abb1cc436fca5bf75d (patch)
tree8386b256f30308d0a8e7d727c6aead0f8feeee73 /js/message.js
parent3a3956e8a258784461270961c6577341356bce52 (diff)
downloadprotobuf-176f7db11d8242b36a3ea6abb1cc436fca5bf75d.tar.gz
Down integrate to Github
Diffstat (limited to 'js/message.js')
-rw-r--r--js/message.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/js/message.js b/js/message.js
index 5ca0a7331..aa6e15779 100644
--- a/js/message.js
+++ b/js/message.js
@@ -172,7 +172,8 @@ jspb.Message = function() {
* dead code eliminate fields used in protocol buffers that are never used
* in an application.
*/
-goog.define('jspb.Message.GENERATE_TO_OBJECT', true);
+jspb.Message.GENERATE_TO_OBJECT =
+ goog.define('jspb.Message.GENERATE_TO_OBJECT', true);
/**
@@ -184,7 +185,8 @@ goog.define('jspb.Message.GENERATE_TO_OBJECT', true);
* used in an application.
* By default this is enabled for test code only.
*/
-goog.define('jspb.Message.GENERATE_FROM_OBJECT', !goog.DISALLOW_TEST_ONLY_CODE);
+jspb.Message.GENERATE_FROM_OBJECT = goog.define(
+ 'jspb.Message.GENERATE_FROM_OBJECT', !goog.DISALLOW_TEST_ONLY_CODE);
/**
@@ -192,7 +194,8 @@ goog.define('jspb.Message.GENERATE_FROM_OBJECT', !goog.DISALLOW_TEST_ONLY_CODE);
* this off if you do not use toString in your project and want to trim it
* from the compiled JS.
*/
-goog.define('jspb.Message.GENERATE_TO_STRING', true);
+jspb.Message.GENERATE_TO_STRING =
+ goog.define('jspb.Message.GENERATE_TO_STRING', true);
/**
@@ -200,7 +203,8 @@ goog.define('jspb.Message.GENERATE_TO_STRING', true);
* local (e.g. not from another iframe) and thus safely classified with
* instanceof Array.
*/
-goog.define('jspb.Message.ASSUME_LOCAL_ARRAYS', false);
+jspb.Message.ASSUME_LOCAL_ARRAYS =
+ goog.define('jspb.Message.ASSUME_LOCAL_ARRAYS', false);
// TODO(jakubvrana): Turn this off by default.
@@ -210,7 +214,8 @@ goog.define('jspb.Message.ASSUME_LOCAL_ARRAYS', false);
* the proto before serialization. This is enabled by default to be
* backwards compatible. Projects are advised to turn this flag always off.
*/
-goog.define('jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS', true);
+jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS =
+ goog.define('jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS', true);
/**
@@ -326,6 +331,10 @@ jspb.Message.getIndex_ = function(msg, fieldNumber) {
return fieldNumber + msg.arrayIndexOffset_;
};
+// This is only here to ensure we are not back sliding on ES6 requiements for
+// protos in g3.
+jspb.Message.hiddenES6Property_ = class {};
+
/**
* Returns the tag number based on the index in msg.array.