| 1 | define(["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 | }); |