[Pkg-javascript-commits] [node-stream-http] 80/208: Modify feature testing to avoid warnings in Chrome
Bastien Roucariès
rouca at moszumanska.debian.org
Sun Aug 13 13:39:31 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-stream-http.
commit a91ed0db64ff56bb9ab0f8e2a13e4aa28e2e786e
Author: John Hiesey <john at hiesey.com>
Date: Thu Aug 20 01:06:34 2015 -0700
Modify feature testing to avoid warnings in Chrome
Previously, testing for 'ms-stream' and 'moz-chunked-arraybuffer'
support on the xhr object caused warnings to appear in Chrome.
Since fetch will always be used instead of these when available,
short-circuit and return false when fetch is available.
---
lib/capability.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/capability.js b/lib/capability.js
index 747bd73..bc637d8 100644
--- a/lib/capability.js
+++ b/lib/capability.js
@@ -23,8 +23,11 @@ var haveArrayBuffer = typeof window.ArrayBuffer !== 'undefined'
var haveSlice = haveArrayBuffer && isFunction(window.ArrayBuffer.prototype.slice)
exports.arraybuffer = haveArrayBuffer && checkTypeSupport('arraybuffer')
-exports.msstream = haveSlice && checkTypeSupport('ms-stream')
-exports.mozchunkedarraybuffer = haveArrayBuffer && checkTypeSupport('moz-chunked-arraybuffer')
+// These next two tests unavoidably show warnings in Chrome. Since fetch will always
+// be used if it's available, just return false for these to avoid the warnings.
+exports.msstream = !exports.fetch && haveSlice && checkTypeSupport('ms-stream')
+exports.mozchunkedarraybuffer = !exports.fetch && haveArrayBuffer &&
+ checkTypeSupport('moz-chunked-arraybuffer')
exports.overrideMimeType = isFunction(xhr.overrideMimeType)
exports.vbArray = isFunction(window.VBArray)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-stream-http.git
More information about the Pkg-javascript-commits
mailing list