OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 goog.asserts.assert(object['getExtension'], | 61 goog.asserts.assert(object['getExtension'], |
62 'Only unobfuscated and unoptimized compilation modes supported.'); | 62 'Only unobfuscated and unoptimized compilation modes supported.'); |
63 return /** @type {Object} */ (jspb.debug.dump_(message)); | 63 return /** @type {Object} */ (jspb.debug.dump_(message)); |
64 }; | 64 }; |
65 | 65 |
66 | 66 |
67 /** | 67 /** |
68 * Recursively introspects a message and the values its getters return to | 68 * Recursively introspects a message and the values its getters return to |
69 * make a best effort in creating a human readable representation of the | 69 * make a best effort in creating a human readable representation of the |
70 * message. | 70 * message. |
71 * @param {*} thing A jspb.Message, Array or primitive type to dump. | 71 * @param {?} thing A jspb.Message, Array or primitive type to dump. |
72 * @return {*} | 72 * @return {*} |
73 * @private | 73 * @private |
74 */ | 74 */ |
75 jspb.debug.dump_ = function(thing) { | 75 jspb.debug.dump_ = function(thing) { |
76 var type = goog.typeOf(thing); | 76 var type = goog.typeOf(thing); |
77 if (type == 'number' || type == 'string' || type == 'boolean' || | 77 if (type == 'number' || type == 'string' || type == 'boolean' || |
78 type == 'null' || type == 'undefined') { | 78 type == 'null' || type == 'undefined') { |
79 return thing; | 79 return thing; |
80 } | 80 } |
81 if (type == 'array') { | 81 if (type == 'array') { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 * @param {string} name Name of the field. | 131 * @param {string} name Name of the field. |
132 * @return {string} | 132 * @return {string} |
133 * @private | 133 * @private |
134 */ | 134 */ |
135 jspb.debug.formatFieldName_ = function(name) { | 135 jspb.debug.formatFieldName_ = function(name) { |
136 // Name may be in TitleCase. | 136 // Name may be in TitleCase. |
137 return name.replace(/^[A-Z]/, function(c) { | 137 return name.replace(/^[A-Z]/, function(c) { |
138 return c.toLowerCase(); | 138 return c.toLowerCase(); |
139 }); | 139 }); |
140 }; | 140 }; |
OLD | NEW |