defineValueReaders method

void defineValueReaders()

Implementation

void defineValueReaders() {
  if (_isDefined) return;
  _isDefined = true;
  defineValueReader(SerializationTag.kTrue, (location, relatedKey) => true);
  defineValueReader(SerializationTag.kFalse, (location, relatedKey) => false);
  defineValueReader(
      SerializationTag.kTheHole, (location, relatedKey) => hole);
  defineValueReader(
      SerializationTag.kUndefined, (location, relatedKey) => undefined);
  defineValueReader(SerializationTag.kNull, (location, relatedKey) => nul);
  defineValueReader(
      SerializationTag.kInt32, (location, relatedKey) => readZigZag());
  defineValueReader(
      SerializationTag.kUInt32, (location, relatedKey) => reader.getVarint());
  defineValueReader(SerializationTag.kDouble,
      (location, relatedKey) => readDoubleWithRectification());
  defineValueReader(
      SerializationTag.kBigInt, (location, relatedKey) => readBigInt());
  defineValueReader(SerializationTag.kOneByteString, readOneByteString);
  defineValueReader(SerializationTag.kTwoByteString, readTwoByteString);
  defineValueReader(SerializationTag.kUtf8String, readUTF8String);
  defineValueReader(
      SerializationTag.kDate, (location, relatedKey) => readDate());
  defineValueReader(SerializationTag.kTrueObject,
      (location, relatedKey) => readJSBoolean(true));
  defineValueReader(SerializationTag.kFalseObject,
      (location, relatedKey) => readJSBoolean(false));
  defineValueReader(SerializationTag.kNumberObject,
      (location, relatedKey) => readJSNumber());
  defineValueReader(SerializationTag.kBigIntObject,
      (location, relatedKey) => readJSBigInt());
  defineValueReader(SerializationTag.kStringObject, readJSString);
  defineValueReader(
      SerializationTag.kRegexp, (location, relatedKey) => readJSRegExp());
  defineValueReader(SerializationTag.kArrayBuffer,
      (location, relatedKey) => readJSArrayBuffer());
  defineValueReader(SerializationTag.kArrayBufferTransfer,
      (location, relatedKey) => readTransferredJSArrayBuffer());
  defineValueReader(SerializationTag.kSharedArrayBuffer,
      (location, relatedKey) => readSharedArrayBuffer());
  defineValueReader(SerializationTag.kBeginJsObject,
      (location, relatedKey) => readJSObject());
  defineValueReader(
      SerializationTag.kBeginJsMap, (location, relatedKey) => readJSMap());
  defineValueReader(
      SerializationTag.kBeginJsSet, (location, relatedKey) => readJSSet());
  defineValueReader(SerializationTag.kBeginDenseJsArray,
      (location, relatedKey) => readDenseArray());
  defineValueReader(SerializationTag.kBeginSparseJsArray,
      (location, relatedKey) => readSparseArray());
  defineValueReader(SerializationTag.kObjectReference,
      (location, relatedKey) => readObjectReference());
  defineValueReader(SerializationTag.kWasmModuleTransfer,
      (location, relatedKey) => readTransferredWasmModule());
  defineValueReader(SerializationTag.kHostObject,
      (location, relatedKey) => readHostObject());
  defineValueReader(SerializationTag.kWasmMemoryTransfer,
      (location, relatedKey) => readTransferredWasmMemory());
  defineValueReader(
      SerializationTag.kError, (location, relatedKey) => readJSError());
}