diff --git a/compiler/packages/sprout/src/shared-runtime.ts b/compiler/packages/sprout/src/shared-runtime.ts index 076cc3c71c..00dccb8714 100644 --- a/compiler/packages/sprout/src/shared-runtime.ts +++ b/compiler/packages/sprout/src/shared-runtime.ts @@ -32,6 +32,14 @@ export const CONST_NUMBER2 = 2; export const CONST_TRUE = true; export const CONST_FALSE = false; +let count: number = 0; +export function mutate(arg: any): void { + // don't mutate primitive + if (typeof arg != null && typeof arg === "object") { + arg["wat" + count++] = "joe"; + } +} + export function graphql(value: string): string { return value; }