Skip to content

Commit 864e80f

Browse files
committed
Remove getType in jspb.asserts from global namespace
1 parent c6fb314 commit 864e80f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

asserts.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ jspb.asserts.fail = function(opt_message, ...args) {
133133
jspb.asserts.assertInstanceof = function(value, type, opt_message, ...args) {
134134
if (!(value instanceof type)) {
135135
jspb.assert.doAssertFailure(
136-
'Expected instanceof %s but got %s.', [getType(type), getType(value)],
136+
'Expected instanceof %s but got %s.',
137+
[jspb.asserts.getType(type), jspb.asseerts.getType(value)],
137138
opt_message, args);
138139
}
139140
return value;
@@ -144,8 +145,9 @@ jspb.asserts.assertInstanceof = function(value, type, opt_message, ...args) {
144145
* string cannot be found, 'unknown type name' will be returned.
145146
* @param {*} value A constructor, object, or primitive.
146147
* @return {string} The best display name for the value, or 'unknown type name'.
148+
* @private
147149
*/
148-
function getType(value) {
150+
jspb.asserts.getType = function(value) {
149151
if (value instanceof Function) {
150152
return value.displayName || value.name || 'unknown type name';
151153
} else if (value instanceof Object) {

0 commit comments

Comments
 (0)