The Closure compiler is a function, but the code size is smaller if this function is not built-in (I only need the code size - this is for JS1k ). Can I tell the compiler that I do not want this function to be inlined?
Edit: Just to explain a little better, here is my function:
function lineTo(x,y) { a.lineTo(x,y); }
where a in the context of the canvas. Because there is so much a.lineTo in the code that this function is used. So my code is 1019 bytes (and all lineTo are replaced with a.lineTo ). If I changed the function to:
function lineTo(x,y) { a.lineTo(x,y); console.log(); }
the new line somehow forces the compiler not to embed this function, which gives me 993 bytes. Therefore, if I could get rid of console.log(); , I would save another 14 bytes.
javascript google-closure-compiler js1k
Skilldrick
source share