PDA

View Full Version : Is it JS Builder bug or is coding bug?



lingcarlos
15 Dec 2010, 9:02 PM
Hi,dear JS Builder boss and all

my javascript code file has this part :

"content: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\
<html xmlns="http://www.w3.org/1999/xhtml">\
<head>\
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\
{style}\
{script}\
</head>\
<body>\
{mailContent}\
{mailAttachment}\
</body>\
</html>',
"

when i run JS Builder build this file that it's failure and throw error.

the error message is:

'Error: JSMIN unterminated string literal: 10 ...
as JSBuild.JSMin.action(Int32 d)
as JSBuild.JSMin.jsmin()
... etc...
'

but is build OK after i delete "\" and \n

the same problem is your google code as:

http://code.google.com/p/js-builder/issues/detail?id=30

http://code.google.com/p/js-builder/issues/detail?id=31

I do not know if the issue is resolved
we do not need to backslash wrap?

Beeaar
7 Feb 2011, 9:38 AM
I might add a filter for that to the JSBuilder2 line ive added contribs to.

Beeaar
7 Feb 2011, 11:27 AM
It looks like for my build of JSBuilder2, this works fine.

My exact test phrase was:


var bob =
'dkjfkfjkdf dfjdkf" " dfkj \
kdjfkd "" "fj k dfklsdjkldsfj dskl dsdsf \
dskfjkjdkdsfjkfdslfjsfjjfkdsljfsdklfj';

Beeaar
7 Feb 2011, 12:05 PM
I just tried your string. Its not the line wrap thats causing it to blow, at least in the version i have. And its for sure not the tool JSBuilder itself.


Ext.lib.Dom.getRegion = function(el) {
var bob = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> {style}{script}</head><body>{mailContent}{mailAttachment}</body></html>';
return Ext.lib.Region.getRegion(el);
};

You can try that in JSLint and it passes. Try it with the paser for the compressor and it blows. I'm on crack or its jsut nto parsing it correctly and blowing. Some kind of escape or sequence i dot kno0w about?

Beeaar
7 Feb 2011, 12:08 PM
[java] Exception in thread "main" java.lang.NullPointerException
[java] at org.mozilla.javascript.Parser.addError(Parser.java:141)
[java] at org.mozilla.javascript.TokenStream.getToken(TokenStream.java:518)

lingcarlos
13 Feb 2011, 11:25 PM
JS builder version 1.1.2 is used by me, it's not JSbuilder2,very pleased know new version that is ok by your help,Really, very grateful again, you are a very nice person