From e4869ff524f3e71e679f16b66f713176b288b108 Mon Sep 17 00:00:00 2001 From: Mike de Boer Date: Thu, 19 Nov 2015 22:11:50 +0100 Subject: [PATCH] No bug: Array.slice not supported by Chrome, which the link clicker doesn't like. Use Array.prototype.slice instead. rs=Standard8 --- browser/components/loop/content/shared/js/loopapi-client.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/browser/components/loop/content/shared/js/loopapi-client.js b/browser/components/loop/content/shared/js/loopapi-client.js index 0d88900e2294..916062cc65a2 100644 --- a/browser/components/loop/content/shared/js/loopapi-client.js +++ b/browser/components/loop/content/shared/js/loopapi-client.js @@ -6,6 +6,8 @@ var loop = loop || {}; (function() { "use strict"; + var _slice = Array.prototype.slice; + var kMessageName = "Loop:Message"; var kPushMessageName = "Loop:Message:Push"; var kBatchMessage = "Batch"; @@ -51,7 +53,7 @@ var loop = loop || {}; * script sent a reply. It never gets rejected. */ loop.request = function request() { - var args = Array.slice(arguments); + var args = _slice.call(arguments); return new Promise(function(resolve) { var payload = buildRequestArray(args); @@ -107,7 +109,7 @@ var loop = loop || {}; throw new Error("loop.requestMulti: please pass in a list of calls to process in parallel."); } - var calls = Array.slice(arguments); + var calls = _slice.call(arguments); calls.forEach(function(call) { if (!Array.isArray(call)) { throw new Error("loop.requestMulti: each call must be an array of options, " +