зеркало из https://github.com/mozilla/gecko-dev.git
No bug: Array.slice not supported by Chrome, which the link clicker doesn't like. Use Array.prototype.slice instead. rs=Standard8
This commit is contained in:
Родитель
dc20c7f9ef
Коммит
e4869ff524
|
@ -6,6 +6,8 @@ var loop = loop || {};
|
||||||
(function() {
|
(function() {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
var _slice = Array.prototype.slice;
|
||||||
|
|
||||||
var kMessageName = "Loop:Message";
|
var kMessageName = "Loop:Message";
|
||||||
var kPushMessageName = "Loop:Message:Push";
|
var kPushMessageName = "Loop:Message:Push";
|
||||||
var kBatchMessage = "Batch";
|
var kBatchMessage = "Batch";
|
||||||
|
@ -51,7 +53,7 @@ var loop = loop || {};
|
||||||
* script sent a reply. It never gets rejected.
|
* script sent a reply. It never gets rejected.
|
||||||
*/
|
*/
|
||||||
loop.request = function request() {
|
loop.request = function request() {
|
||||||
var args = Array.slice(arguments);
|
var args = _slice.call(arguments);
|
||||||
|
|
||||||
return new Promise(function(resolve) {
|
return new Promise(function(resolve) {
|
||||||
var payload = buildRequestArray(args);
|
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.");
|
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) {
|
calls.forEach(function(call) {
|
||||||
if (!Array.isArray(call)) {
|
if (!Array.isArray(call)) {
|
||||||
throw new Error("loop.requestMulti: each call must be an array of options, " +
|
throw new Error("loop.requestMulti: each call must be an array of options, " +
|
||||||
|
|
Загрузка…
Ссылка в новой задаче