source: Dev/branches/rest-dojo-ui/client/util/build/removeComments.js @ 256

Last change on this file since 256 was 256, checked in by hendrikvanantwerpen, 13 years ago

Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).

File size: 526 bytes
Line 
1define(["dojo/has"], function(has){
2        // FIXME: this module should be replaced with a proper parser to correctly remove comments
3        // see extensive commentary in dojo/_base/loader.js
4
5        if(has("host-rhino")){
6                return function(text){
7                        return text.replace(/(\/\*([\s\S]*?)\*\/|\/\/(.*)$)/mg, "");
8                        // FIXME: try something like the following in rhino...
9                        //var f = new Function(text);
10                        //return f.toString();
11                };
12        }else{
13                return function(text){
14                        return text.replace(/(\/\*([\s\S]*?)\*\/|\/\/(.*)$)/mg, "");
15                };
16        }
17});
Note: See TracBrowser for help on using the repository browser.