#875 - protect global property variable - with regression test
git-svn-id: http://svn.openlayers.org/trunk/openlayers@3837 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -49,7 +49,7 @@ if ($ == null) {
|
||||
*/
|
||||
OpenLayers.Util.extend = function(destination, source) {
|
||||
if(destination && source) {
|
||||
for(property in source) {
|
||||
for(var property in source) {
|
||||
destination[property] = source[property];
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -580,7 +580,7 @@
|
||||
}
|
||||
|
||||
function tests_Util_extend(t) {
|
||||
t.plan(4);
|
||||
t.plan(5);
|
||||
var source = {
|
||||
num: Math.random(),
|
||||
obj: {
|
||||
@@ -602,6 +602,7 @@
|
||||
"extend properly sets function property on destination");
|
||||
t.eq(destination.toString(), "source",
|
||||
"extend properly sets custom toString method");
|
||||
t.eq(window.property, undefined, "Property variable not clobbered.");
|
||||
}
|
||||
|
||||
function test_XX_Util_Try(t) {
|
||||
|
||||
Reference in New Issue
Block a user