protect for in loops with hasOwnProperty
This commit is contained in:
@@ -84,8 +84,10 @@ OpenLayers.Format.WMTSCapabilities = OpenLayers.Class(OpenLayers.Format.XML.Vers
|
||||
matrixSet: true
|
||||
};
|
||||
for (var prop in required) {
|
||||
if (!(prop in config)) {
|
||||
throw new Error("Missing property '" + prop + "' in layer configuration.");
|
||||
if (required.hasOwnProperty(prop)) {
|
||||
if (!(prop in config)) {
|
||||
throw new Error("Missing property '" + prop + "' in layer configuration.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user