as universally approved on discussions on dev list, replace new Object() with {}. all tests pass ff & ie6

git-svn-id: http://svn.openlayers.org/trunk/openlayers@3814 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2007-07-25 22:39:28 +00:00
parent 6d2e84892d
commit 5f0bde51da
19 changed files with 29 additions and 29 deletions

View File

@@ -429,7 +429,7 @@ OpenLayers.Bounds = OpenLayers.Class({
* merely a copy of this one.
*/
wrapDateLine: function(maxExtent, options) {
options = options || new Object();
options = options || {};
var leftTolerance = options.leftTolerance || 0;
var rightTolerance = options.rightTolerance || 0;

View File

@@ -32,7 +32,7 @@ OpenLayers.Class = function() {
this.initialize.apply(this, arguments);
}
}
var extended = new Object();
var extended = {};
var parent;
for(var i=0; i<arguments.length; ++i) {
if(typeof arguments[i] == "function") {

View File

@@ -74,7 +74,7 @@ OpenLayers.Control.MouseToolbar = OpenLayers.Class(
draw: function() {
OpenLayers.Control.prototype.draw.apply(this, arguments);
OpenLayers.Control.MouseDefaults.prototype.draw.apply(this, arguments);
this.buttons = new Object();
this.buttons = {};
var sz = new OpenLayers.Size(28,28);
var centered = new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,0);
this._addButton("zoombox", "drag-rectangle-off.png", "drag-rectangle-on.png", centered, sz, "Shift->Drag to zoom to area");

View File

@@ -171,7 +171,7 @@ OpenLayers.Event = {
//if observers cache has not yet been created, create it
if (!this.observers) {
this.observers = new Object();
this.observers = {};
}
//if not already assigned, make a new unique cache ID
@@ -398,7 +398,7 @@ OpenLayers.Events = OpenLayers.Class({
this.element = element;
this.eventTypes = eventTypes;
this.fallThrough = fallThrough;
this.listeners = new Object();
this.listeners = {};
// keep a bound copy of handleBrowserEvent() so that we can
// pass the same function to both Event.observe() and .stopObserving()
@@ -589,7 +589,7 @@ OpenLayers.Events = OpenLayers.Class({
// prep evt object with object & div references
if (evt == null) {
evt = new Object();
evt = {};
}
evt.object = this.object;
evt.element = this.element;

View File

@@ -70,7 +70,7 @@ OpenLayers.Feature = OpenLayers.Class({
initialize: function(layer, lonlat, data) {
this.layer = layer;
this.lonlat = lonlat;
this.data = (data != null) ? data : new Object();
this.data = (data != null) ? data : {};
this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
},

View File

@@ -74,7 +74,7 @@ OpenLayers.Feature.Vector = OpenLayers.Class(OpenLayers.Feature, {
this.lonlat = null;
this.geometry = geometry;
this.state = null;
this.attributes = new Object();
this.attributes = {};
if (attributes) {
this.attributes = OpenLayers.Util.extend(this.attributes,
attributes);

View File

@@ -315,7 +315,7 @@ OpenLayers.Layer = OpenLayers.Class({
addOptions: function (newOptions) {
if (this.options == null) {
this.options = new Object();
this.options = {};
}
// update our copy for clone
@@ -569,7 +569,7 @@ OpenLayers.Layer = OpenLayers.Class({
// resolution-related properties that we find in either the layer's
// 'options' array or from the map.
//
var confProps = new Object();
var confProps = {};
for(var i=0; i < props.length; i++) {
var property = props[i];
confProps[property] = this.options[property] || this.map[property];

View File

@@ -56,7 +56,7 @@ OpenLayers.Layer.HTTPRequest = OpenLayers.Class(OpenLayers.Layer, {
newArguments = [name, options];
OpenLayers.Layer.prototype.initialize.apply(this, newArguments);
this.url = url;
this.params = OpenLayers.Util.extend( new Object(), params);
this.params = OpenLayers.Util.extend( {}, params);
},
/**
@@ -167,7 +167,7 @@ OpenLayers.Layer.HTTPRequest = OpenLayers.Class(OpenLayers.Layer, {
// create a new params hashtable with all the layer params and the
// new params together. then convert to string
var allParams = OpenLayers.Util.extend(new Object(), this.params);
var allParams = OpenLayers.Util.extend({}, this.params);
allParams = OpenLayers.Util.extend(allParams, newParams);
var paramsString = OpenLayers.Util.getParameterString(allParams);

View File

@@ -153,7 +153,7 @@ OpenLayers.Layer.MapServer = OpenLayers.Class(OpenLayers.Layer.Grid, {
// create a new params hashtable with all the layer params and the
// new params together. then convert to string
var allParams = OpenLayers.Util.extend(new Object(), this.params);
var allParams = OpenLayers.Util.extend({}, this.params);
allParams = OpenLayers.Util.extend(allParams, newParams);
// ignore parameters that are already in the url search string
var urlParams = OpenLayers.Util.upperCaseObject(

View File

@@ -120,7 +120,7 @@ OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, {
}
}
if (set) {
var data = new Object();
var data = {};
if (url != null) {
data.icon = new OpenLayers.Icon(url,
iconSize,

View File

@@ -6,7 +6,7 @@
/**
* Namespace: Util
*/
OpenLayers.Util = new Object();
OpenLayers.Util = {};
/**
* Function: getElement
@@ -459,7 +459,7 @@ OpenLayers.Util.createAlphaImageDiv = function(id, px, sz, imgURL,
* {Object} A new Object with all the same keys but uppercased
*/
OpenLayers.Util.upperCaseObject = function (object) {
var uObject = new Object();
var uObject = {};
for (var key in object) {
uObject[key.toUpperCase()] = object[key];
}
@@ -767,7 +767,7 @@ OpenLayers.Util.getArgs = function(url) {
return {};
}
var args = new Object();
var args = {};
pairs = query.split(/[&;]/);
for(var i = 0; i < pairs.length; ++i) {
keyValue = pairs[i].split('=');
@@ -971,7 +971,7 @@ OpenLayers.Util.pagePosition = function(forElement) {
* {Boolean} Whether or not the two URLs are equivalent
*/
OpenLayers.Util.isEquivalentUrl = function(url1, url2, options) {
options = options || new Object();
options = options || {};
OpenLayers.Util.applyDefaults(options, {
ignoreCase: true,
@@ -1041,9 +1041,9 @@ OpenLayers.Util.isEquivalentUrl = function(url1, url2, options) {
* and ready for comparison
*/
OpenLayers.Util.createUrlObject = function(url, options) {
options = options || new Object();
options = options || {};
var urlObject = new Object();
var urlObject = {};
if (options.ignoreCase) {
url = url.toLowerCase();