From 154562778d39693da770af9db15bdecaeaa1ed96 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sun, 28 Dec 2014 20:14:17 -0600 Subject: [PATCH 1/5] Assign to `self` --- fetch.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fetch.js b/fetch.js index e91a45b5..fca2c3c8 100644 --- a/fetch.js +++ b/fetch.js @@ -1,7 +1,7 @@ -(function(global) { +(function() { 'use strict'; - if (global.fetch) { + if (self.fetch) { return } @@ -203,7 +203,7 @@ Body.call(Response.prototype) - global.fetch = function (url, options) { + self.fetch = function (url, options) { return new Request(url, options).fetch() } -})(this); +})(); From 9562884059929c5966dd4b189f7e2c1220e644af Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sun, 28 Dec 2014 20:17:00 -0600 Subject: [PATCH 2/5] Allow `self` global in browsers --- .jshintrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.jshintrc b/.jshintrc index 763bb5eb..0971da0f 100644 --- a/.jshintrc +++ b/.jshintrc @@ -17,6 +17,7 @@ "eqnull": true, "browser": true, "globals": { - "Promise": false + "Promise": false, + "self": false } } From b5a75f35c630ebccf020a0eb99666b1b190635a3 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 29 Dec 2014 12:27:33 -0600 Subject: [PATCH 3/5] Define worker context --- .jshintrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.jshintrc b/.jshintrc index 0971da0f..7fc07728 100644 --- a/.jshintrc +++ b/.jshintrc @@ -16,8 +16,8 @@ "asi": true, "eqnull": true, "browser": true, + "worker": true, "globals": { - "Promise": false, - "self": false + "Promise": false } } From 3ebc44129997dbc2e331450b6e876b8f6e36437b Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 29 Dec 2014 12:28:44 -0600 Subject: [PATCH 4/5] Set esnext option --- .jshintrc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.jshintrc b/.jshintrc index 7fc07728..604e4aac 100644 --- a/.jshintrc +++ b/.jshintrc @@ -12,12 +12,10 @@ "unused": true, "strict": true, "trailing": true, - "boss": true, "asi": true, + "boss": true, + "esnext": true, "eqnull": true, "browser": true, - "worker": true, - "globals": { - "Promise": false - } + "worker": true } From 1898d56433838c4b7c0bbaa349cc7eb8003ded95 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 29 Dec 2014 12:29:39 -0600 Subject: [PATCH 5/5] Add worker to test lint config --- test/.jshintrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/.jshintrc b/test/.jshintrc index d176101e..2c40fb24 100644 --- a/test/.jshintrc +++ b/test/.jshintrc @@ -10,11 +10,13 @@ "undef": true, "unused": true, "trailing": true, - "boss": true, "asi": true, + "boss": true, + "esnext": true, "sub": true, "eqnull": true, "browser": true, + "worker": true, "globals": { "MockXHR": false, "QUnit": false,