From f682861e0b420e1dc8123587734600cb00f91f06 Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Sun, 14 Oct 2018 19:01:09 -0400 Subject: [PATCH] Fixed utils.poll from mutating passed variables. --- src.ts/utils/web.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src.ts/utils/web.ts b/src.ts/utils/web.ts index 050804ad..07470dc2 100644 --- a/src.ts/utils/web.ts +++ b/src.ts/utils/web.ts @@ -3,6 +3,7 @@ import { XMLHttpRequest } from 'xmlhttprequest'; import { encode as base64Encode } from './base64'; +import { shallowCopy } from './properties'; import { toUtf8Bytes } from './utf8'; import * as errors from '../errors'; @@ -180,6 +181,7 @@ export function fetchJson(connection: string | ConnectionInfo, json: string, pro export function poll(func: () => Promise, options?: PollOptions): Promise { if (!options) { options = {}; } + options = shallowCopy(options); if (options.floor == null) { options.floor = 0; } if (options.ceiling == null) { options.ceiling = 10000; } if (options.interval == null) { options.interval = 250; }