OpenLayers OpenLayers

Ticket #1502: object_extension.patch

File object_extension.patch, 1.6 kB (added by crschmidt, 5 months ago)
  • tests/Extras.html

    old new  
     1<html> 
     2<head> 
     3  <script src="../lib/OpenLayers.js"></script> 
     4  <script type="text/javascript"> 
     5 
     6    var isMozilla = (navigator.userAgent.indexOf("compatible") == -1); 
     7    var map; 
     8     
     9    // Ensure that we continue to work if silly Javascript frameworks 
     10    // extend object. 
     11    Object.prototype.foo = function() { } 
     12    function test_Events_Object_Extension(t) { 
     13        t.plan(1) 
     14        m = new OpenLayers.Map("map"); 
     15        t.ok("Map created if object prototype is extended."); 
     16    } 
     17  </script> 
     18</head> 
     19<body> 
     20    <div id="map" style="width: 600px; height: 300px;"/> 
     21</body> 
     22</html> 
  • tests/list-tests.html

    old new  
    11<ul id="testlist"> 
    22    <li>OpenLayers.html</li> 
     3    <li>Extras.html</li> 
    34    <li>Ajax.html</li> 
    45    <li>BaseTypes.html</li> 
    56    <li>BaseTypes/Bounds.html</li> 
  • lib/OpenLayers/Events.js

    old new  
    532532     */ 
    533533    register: function (type, obj, func) { 
    534534 
    535         if (func != null) { 
     535        if (func != null &&  
     536            OpenLayers.Util.indexOf(this.eventTypes, type) != -1) { 
    536537            if (obj == null)  { 
    537538                obj = this.object; 
    538539            }