Skip to content

Commit 285da41

Browse files
Fixes
1 parent dbeaa0d commit 285da41

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

packages/firestore/src/api/field_value.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,11 @@ export class NumericIncrementFieldValueImpl extends SerializableFieldValue {
189189
}
190190

191191
_toFieldTransform(context: ParseContext): FieldTransform {
192-
return new FieldTransform(
193-
context.path!,
192+
const numericIncrement = new NumericIncrementTransformOperation(
193+
context.serializer,
194194
toNumber(context.serializer, this._operand)
195195
);
196+
return new FieldTransform(context.path!, numericIncrement);
196197
}
197198

198199
isEqual(other: FieldValue): boolean {

packages/firestore/src/model/mutation.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ export class FieldTransform {
8989
) {}
9090
}
9191

92-
export function fieldTransformEquals(l: FieldTransform, r: FieldTransform) {
92+
export function fieldTransformEquals(
93+
l: FieldTransform,
94+
r: FieldTransform
95+
): boolean {
9396
return (
9497
l.field.isEqual(r.field) &&
9598
transformOperationEquals(l.transform, r.transform)

packages/firestore/src/model/transform_operation.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
} from './values';
3030
import { serverTimestamp } from './server_timestamps';
3131
import { arrayEquals } from '../util/misc';
32-
import instantiate = WebAssembly.instantiate;
3332

3433
/** Represents a transform within a TransformMutation. */
3534
export interface TransformOperation {}
@@ -209,7 +208,7 @@ export class NumericIncrementTransformOperation implements TransformOperation {
209208
export function applyNumericIncrementTransform(
210209
transform: NumericIncrementTransformOperation,
211210
previousValue: api.Value | null
212-
) {
211+
): api.Value {
213212
// PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit
214213
// precision and resolves overflows by reducing precision, we do not
215214
// manually cap overflows at 2^63.

0 commit comments

Comments
 (0)