From 5e518b741704b738e29352c341ee6a956cce1fff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BF=B7=E6=B8=A1?= Date: Thu, 27 Dec 2018 10:12:55 +0800 Subject: check runtime `FormData` and `Headers` params (#1415) --- js/mixins/dom_iterable.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'js/mixins') diff --git a/js/mixins/dom_iterable.ts b/js/mixins/dom_iterable.ts index 2daf80b71..6a2a9fcfe 100644 --- a/js/mixins/dom_iterable.ts +++ b/js/mixins/dom_iterable.ts @@ -1,5 +1,6 @@ import { DomIterable } from "../dom_types"; import { globalEval } from "../global_eval"; +import { requiredArguments } from "../util"; // if we import it directly from "globals" it will break the unit tests so we // have to grab a reference to the global scope a different way @@ -52,6 +53,11 @@ export function DomIterableMixin( // tslint:disable-next-line:no-any thisArg?: any ): void { + requiredArguments( + `${this.constructor.name}.forEach`, + arguments.length, + 1 + ); callbackfn = callbackfn.bind(thisArg == null ? window : Object(thisArg)); for (const [key, value] of (this as any)[dataSymbol]) { callbackfn(value, key, this); -- cgit v1.2.3