Comment

Peter Bengtsson

That's a very interesting read. I figured what one can do is to relabel all functions that are repeated by generating new code in the slimmer. So if you start with this code::

function parseSomething(z) {
...
}
function foo(x, y) {
return parseSomething(x) + parseSomething(y);
}

Then this can be revamped to this::

function A(z) {
...
}
function foo(x, y) {
return A(x) + A(y);
}
var parseSomething=A;

Not a big saving, but at least something.

Parent comment

Simon

Since JavaScript has no notion of a module, there is can be no "private" functions as used in your Python example (which aren't that private either: "from dummy import _thisIsPrivate; _thisIsPrivate()"). And I've never really seen functions beginning with underscores outside of OO-like programming (where technically private functions are possible: http://www.crockford.com/javascript/private.html). As for your slimmer: what about simply testing for the existence of a function of the slimmed name first? And for inspiration, you might want to have a look at other products with the same functionality (http://www.google.com/search?q=javascript%20obfuscator).