From 7d06525970fb4318c5ab41b807428e566eefd575 Mon Sep 17 00:00:00 2001 From: james2406 Date: Wed, 29 May 2019 09:18:40 +0100 Subject: [PATCH] Accept window and document arguments in polyfill method --- src/smoothscroll.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/smoothscroll.js b/src/smoothscroll.js index 6faa8f7..e74cd9e 100644 --- a/src/smoothscroll.js +++ b/src/smoothscroll.js @@ -1,11 +1,7 @@ 'use strict'; // polyfill -function polyfill() { - // aliases - var w = window; - var d = document; - +function polyfill(w = window, d = document) { // return if scroll behavior is supported and polyfill is not forced if ( 'scrollBehavior' in d.documentElement.style &&