From 22034d3305a8f8e6ca77f43fcdc55baef5aaaa45 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Wed, 5 Nov 2014 12:36:31 -0800 Subject: [PATCH] [Framework] Slice arguments correctly Fix arguments-to-array conversions used for extension registration. WTD-518. --- platform/framework/src/register/ExtensionRegistrar.js | 2 +- platform/framework/src/register/PartialConstructor.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/framework/src/register/ExtensionRegistrar.js b/platform/framework/src/register/ExtensionRegistrar.js index 3d471dcdfd..ed5e67be10 100644 --- a/platform/framework/src/register/ExtensionRegistrar.js +++ b/platform/framework/src/register/ExtensionRegistrar.js @@ -37,7 +37,7 @@ define( // Echo arguments; used to represent groups of non-built-in // extensions as a single dependency. function echo() { - return arguments.slice(); + return Array.prototype.slice.call(arguments); } // Always return a static value; used to represent plain diff --git a/platform/framework/src/register/PartialConstructor.js b/platform/framework/src/register/PartialConstructor.js index 422a51938f..466851db50 100644 --- a/platform/framework/src/register/PartialConstructor.js +++ b/platform/framework/src/register/PartialConstructor.js @@ -27,10 +27,10 @@ define( function PartialConstructor(Constructor) { return function () { // Bind services - var dependencies = arguments.slice(); + var dependencies = Array.prototype.slice.call(arguments); return function () { // Bind everything else - var other = arguments.slice(), + var other = Array.prototype.slice.call(arguments), instance = {}; Constructor.apply(instance, dependencies.concat(other));