Changeset 1904 for trunk


Ignore:
Timestamp:
2011-05-23 11:36:59 (12 months ago)
Author:
jgou
Message:

Remove (unnecessary) extra closure, because wrapping the JSON variable declaration causes native JSON implementations (which are available in modern browsers) to be overwritten. This fixes #454 .

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/kauri-jquery/src/main/kauri/static-{build}.key/kauri.util/json2.js

    r1818 r1904  
    165165// methods in a closure to avoid creating global variables. 
    166166 
    167 ; 
    168 (function($) { 
    169  
     167var JSON; 
     168if (!JSON) { 
     169    JSON = {}; 
     170} 
     171 
     172(function ($) { 
     173    "use strict"; 
     174     
    170175    if (!$) 
    171176        throw "[json2.js] requires jQuery"; 
     
    174179 
    175180    var kp = $.org.kauriproject; 
    176  
    177 var JSON; 
    178 if (!JSON) { 
    179     JSON = {}; 
    180 } 
    181  
    182 (function () { 
    183     "use strict"; 
    184181 
    185182    function f(n) { 
     
    493490        }; 
    494491    } 
    495 }()); 
    496  
     492     
    497493    // add JSON object to namespace 
    498494    $.extend(kp, { 
    499495        JSON :JSON 
    500496    }); 
    501 })(jQuery); 
     497     
     498}(jQuery)); 
Note: See TracChangeset for help on using the changeset viewer.