online javascript formatter

Y

Yoo

Is there an online javascript formatter that pass the following five
tests? Is there at least one that pass all five tests except test 2?

Test 1 : make the following code look good.
var s= abc( a , b,c)

Only JFC among the following three tools modifies the spacing of this
code.
Bookmarklet Builder (BB)
http://subsimple.com/bookmarklets/jsbuilder.htm
Click Me - Scriptedit (CMS)
http://4umi.com/web/bookmarklet/edit.htm
Javascript Format and Color (JFC)
http://javascript.about.com/library/blformat.htm


Test 2 : Don't destroy the following code.
a = 1
b = 2

BB, CMS and JFC, all of them change this code into:
a = 1b = 2


Test 3 : Don't destroy the following code.
a/**/=/**/1//if(1){a=1} /*
b=1/*abc
// */c=1

CMS destroys this code changing the code into:
a$1=$11
b=1/*abc


Test 4 : Indent function bodies of the following.
abc(function(){s=1;s=2},function(){s=1;s=2},{a:1,b:2})

Only JFC indents function bodies


Test 5 : Indent the following.
if(s)b=1;else c=2

Only BB indents both b=1 and c=2.


Summary
1 2 3 4 5
BB o o
CMS
JFC o o o
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top