vb.net - Google Closure Compiler returns no compiled code? -


in question here @ stack overflow, came across helpful code snippet send code google closure compiler, can minify javascript files pretty good.

the problem i'm facing returns no compiled code in cases don't expect so.

code:

this works, i.e. returns minified code:

    dim script = "function test(name) {alert(name);}test('new user');" 

this one, on other hand, not return anything. statistics sent, no compiled data...:

    dim script = "function test(name) {alert(name);}" 

rest of code work:

    dim data = string.format(closurewebservicepostdata, httputility.urlencode(script))      _result = new stringbuilder     _httpwebrequest = directcast(webrequest.create(closurewebserviceurl), httpwebrequest)     _httpwebrequest.method = "post"     _httpwebrequest.contenttype = "application/x-www-form-urlencoded"     '//set content length length of data. might need change if you're using characters take more 256 bytes     _httpwebrequest.contentlength = data.length     '//write request stream     using sw new streamwriter(_httpwebrequest.getrequeststream())         sw.write(data)     end using       dim response webresponse = _httpwebrequest.getresponse()      using responsestream stream = response.getresponsestream         dim encoding encoding = system.text.encoding.getencoding("utf-8")         using readstream new streamreader(responsestream, encoding)             dim read(256) char             dim count integer = readstream.read(read, 0, 256)             while count > 0                 dim str new string(read, 0, count)                 _result.append(str)                 count = readstream.read(read, 0, 256)             end while         end using     end using 

what casue @ all? i'm curious know.

possibly using advanced_optimizations setting? function may have been stripped because defined, never used.

check out page: closure compiler tutorial


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -