From df8ca4a1de4717e85ec69ebbf479eb88f27c22a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Tue, 15 Nov 2016 15:21:34 +0100 Subject: [PATCH] Avoid using `native` keyword as variable Fixes the test suite in some older browsers that choke on it. --- test/test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test.js b/test/test.js index e1b2270..9003a98 100644 --- a/test/test.js +++ b/test/test.js @@ -73,7 +73,7 @@ function readArrayBufferAsText(buf) { return chars.join('') } -var native = {} +var preservedGlobals = {} var keepGlobals = ['fetch', 'Headers', 'Request', 'Response'] var exercise = ['polyfill'] @@ -81,7 +81,7 @@ var exercise = ['polyfill'] // by the polyfill. Native implementation will be exercised additionally. if (self.fetch) { keepGlobals.forEach(function(name) { - native[name] = self[name] + preservedGlobals[name] = self[name] }) self.fetch = undefined exercise.push('native') @@ -98,7 +98,7 @@ exercise.forEach(function(exerciseMode) { if (exerciseMode === 'native') { suiteSetup(function() { keepGlobals.forEach(function(name) { - self[name] = native[name] + self[name] = preservedGlobals[name] }) }) } -- GitLab