From 99f6e65e7b0badc02fa1ec81db98c0743aa5b583 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 30 May 2012 09:56:06 +0200 Subject: [PATCH] coding style: declare new arrays using [] --- lib/OpenLayers/Events.js | 8 +++----- lib/OpenLayers/Popup/Anchored.js | 7 ++----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/OpenLayers/Events.js b/lib/OpenLayers/Events.js index c2b5b99d46..fb4cde8aef 100644 --- a/lib/OpenLayers/Events.js +++ b/lib/OpenLayers/Events.js @@ -285,11 +285,9 @@ OpenLayers.Event = { if (elementObservers) { for(var i = elementObservers.length-1; i >= 0; i--) { var entry = elementObservers[i]; - var args = new Array(entry.element, - entry.name, - entry.observer, - entry.useCapture); - var removed = OpenLayers.Event.stopObserving.apply(this, args); + OpenLayers.Event.stopObserving.apply(this, [ + entry.element, entry.name, entry.observer, entry.useCapture + ]); } } }, diff --git a/lib/OpenLayers/Popup/Anchored.js b/lib/OpenLayers/Popup/Anchored.js index 0795d9fdef..6909908ca8 100644 --- a/lib/OpenLayers/Popup/Anchored.js +++ b/lib/OpenLayers/Popup/Anchored.js @@ -107,11 +107,8 @@ OpenLayers.Popup.Anchored = moveTo: function(px) { var oldRelativePosition = this.relativePosition; this.relativePosition = this.calculateRelativePosition(px); - - var newPx = this.calculateNewPx(px); - - var newArguments = new Array(newPx); - OpenLayers.Popup.prototype.moveTo.apply(this, newArguments); + + OpenLayers.Popup.prototype.moveTo.call(this, this.calculateNewPx(px)); //if this move has caused the popup to change its relative position, // we need to make the appropriate cosmetic changes.