@@ -111,7 +111,7 @@ export class FieldValueOptions {
111
111
* Potential types returned by FieldValue.value(). This could be stricter
112
112
* (instead of using {}), but there's little benefit.
113
113
*
114
- * Note that currently we use AnyJs (which is identical except includes
114
+ * Note that currently we use `unknown` (which is identical except includes
115
115
* undefined) for incoming user data as a convenience to the calling code (but
116
116
* we'll throw if the data contains undefined). This should probably be changed
117
117
* to use FieldType, but all consuming code will have to be updated to
@@ -367,6 +367,9 @@ export class TimestampValue extends FieldValue {
367
367
* localWriteTime.
368
368
*/
369
369
export class ServerTimestampValue extends FieldValue {
370
+ // TODO(mrschmidt): Represent ServerTimestamps as a PrimitiveType with a
371
+ // Map containing a private `__type__` field (or similar).
372
+
370
373
typeOrder = TypeOrder . TimestampValue ;
371
374
372
375
constructor (
@@ -402,7 +405,7 @@ export class ServerTimestampValue extends FieldValue {
402
405
compareTo ( other : FieldValue ) : number {
403
406
if ( other instanceof ServerTimestampValue ) {
404
407
return this . localWriteTime . _compareTo ( other . localWriteTime ) ;
405
- } else if ( other instanceof TimestampValue ) {
408
+ } else if ( other . typeOrder === TypeOrder . TimestampValue ) {
406
409
// Server timestamps come after all concrete timestamps.
407
410
return 1 ;
408
411
} else {
0 commit comments