Lines Matching +full:- +full:error +full:- +full:asserts
1 // Protocol Buffers - Google's data interchange format
3 // https://developers.google.com/protocol-buffers/
42 goog.require('goog.asserts');
69 * We include `toObjectFn` to allow the JSCompiler to perform dead-code removal
105 * Stores binary-related information for a single extension field.
155 * WARNING - Property serializeBinary never defined on jspb.Message
236 * Wrappers are the constructed instances of message-type fields. They are built
255 * Non-extension fields with a field number at or above the pivot are
274 * for numbers stored as strings (typically "NaN", "Infinity" and "-Infinity")
301 * Otherwise, it will be -1 so that the first array position is not wasted.
333 return index - msg.arrayIndexOffset_;
342 * if no message id is specified. For non-response messages, 0.
345 * contain an extension object already. -1 if no extension object is
362 msg.arrayIndexOffset_ = messageId === 0 ? -1 : 0;
458 // no-EO, no-SP: pivot is MAX_INT
459 // no-EO, SP : pivot is the max(lastindex + 1, SP)
462 var lastIndex = -1;
464 lastIndex = msgLength - 1;
473 if (suggestedPivot > -1) {
484 // suggestedPivot is -1, which means that we don't have an extension object
513 * for transitional soy proto support: http://goto/soy-param-migration
537 * for transitional soy proto support: http://goto/soy-param-migration
568 * Writes a proto's extension data to a binary-format output stream.
570 * @param {*} writer The binary-format writer to write to.
582 // need to gracefully error-out here rather than produce a null dereference
585 throw new Error('Message extension present that was generated ' +
594 // message may require binary support, so we can *only* catch this error
601 throw new Error('Message extension present holding submessage ' +
632 throw new Error('Deserializing extension whose generated code does not ' +
660 * Gets the value of a non-extension field.
689 * Gets the value of a non-extension repeated field.
710 // Converts "NaN", "Infinity" and "-Infinity" to their corresponding numbers.
724 // TODO(b/122673075): always return null when the value is null-ish.
743 // Converts "NaN", "Infinity" and "-Infinity" to their corresponding
787 goog.asserts.fail('Cannot coerce to b64 string: ' + goog.typeOf(value));
806 goog.asserts.fail('Cannot coerce to Uint8Array: ' + goog.typeOf(value));
844 * Asserts that all elements of an array are of the same type.
853 goog.asserts.fail('Inconsistent type in JSPB repeated field array. ' +
862 * Gets the value of a non-extension primitive field, with proto3 (non-nullable
883 * Gets the value of a boolean field, with proto3 (non-nullable primitives)
904 * Gets the value of a floating point field, with proto3 (non-nullable
978 * Sets the value of a non-extension field.
988 goog.asserts.assertInstanceof(msg, jspb.Message);
1000 * Sets the value of a non-extension integer field of a proto3
1014 * Sets the value of a non-extension floating point field of a proto3
1028 * Sets the value of a non-extension boolean field of a proto3
1042 * Sets the value of a non-extension String field of a proto3
1056 * Sets the value of a non-extension Bytes field of a proto3
1070 * Sets the value of a non-extension enum field of a proto3
1084 * Sets the value of a non-extension int field of a proto3 that has jstype set
1098 * Sets the value of a non-extension primitive field, with proto3 (non-nullable
1112 goog.asserts.assertInstanceof(msg, jspb.Message);
1137 goog.asserts.assertInstanceof(msg, jspb.Message);
1161 goog.asserts.assertInstanceof(msg, jspb.Message);
1178 * https://developers.google.com/protocol-buffers/docs/proto#oneof), "if the
1293 goog.asserts.assertInstanceof(msg, jspb.Message);
1316 goog.asserts.assertInstanceof(msg, jspb.Message);
1337 goog.asserts.assertInstanceof(msg, jspb.Message);
1361 * Use go/closure-ttl to declare a non-undefined version of T_CHILD. Replace the
1405 * for transitional soy proto support: http://goto/soy-param-migration
1534 // https://github.com/google/closure-compiler/issues/1411#issuecomment-232442220
1568 * The result will contain the top-level fields of m2 that differ from those of
1570 * share its top-level elements with m2 (but not with m1).
1581 * currently tolerated in Js, but would cause an error if you tried to
1584 * @throws {Error} If the messages are responses with different types.
1588 throw new Error('Messages have different types.');
1675 // If both are Uint8Arrays, compare them element-by-element.
1700 goog.asserts.assert(extension1 === undefined);
1701 goog.asserts.assert(i === typedField1.length - 1);
1707 goog.asserts.assert(extension2 === undefined);
1708 goog.asserts.assert(i === typedField2.length - 1);
1733 throw new Error('Invalid type in JSPB array');
1738 * Templated, type-safe cloneMessage definition.
1760 * Static clone function. NOTE: A type-safe method called "cloneMessage"
1795 goog.asserts.assertInstanceof(fromMessage, jspb.Message);
1796 goog.asserts.assertInstanceof(toMessage, jspb.Message);
1797 goog.asserts.assert(fromMessage.constructor == toMessage.constructor,
1829 // Use array iteration where possible because it is faster than for-in.
1836 jspb.Message.clone_(goog.asserts.assert(o)) :
1852 jspb.Message.clone_(goog.asserts.assert(o)) :
1879 * non-MessageSet. We special case MessageSet so that we do not need