From 32434f9699063388d4e9588a80757de4336c5214 Mon Sep 17 00:00:00 2001 From: Chad Killingsworth Date: Sun, 4 Feb 2018 17:37:32 -0600 Subject: [PATCH] Refactor from a function to a function expression to avoid block scoping (#160) --- dialog-polyfill.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dialog-polyfill.js b/dialog-polyfill.js index 312647a..de96479 100644 --- a/dialog-polyfill.js +++ b/dialog-polyfill.js @@ -689,13 +689,13 @@ * submit event and give us a chance to respond. */ var nativeFormSubmit = HTMLFormElement.prototype.submit; - function replacementFormSubmit() { + var replacementFormSubmit = function () { if (!isFormMethodDialog(this)) { return nativeFormSubmit.call(this); } var dialog = findNearestDialog(this); dialog && dialog.close(); - } + }; HTMLFormElement.prototype.submit = replacementFormSubmit; /**