Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8641519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:32:49+00:00 2026-06-12T11:32:49+00:00

I have two different versions of a javascript file: one works fine, the other

  • 0

I have two different versions of a javascript file: one works fine, the other performs slower. I’ve tried Closure Compiler on both files but… because I’m an idiot, after a few months I was happy to notice the original source file of the good version was missing. Not only from my hard disk, but even from my memory (I can’t remember which changes I’ve made).

So now I have:

    • Compressed code of the well working file
    • Compressed code of the bad working file
    • Uncompressed code of the bad working file

I need to reconstruct the well working source file and, gladly, there are really a few differences between the two compressed version.

Here’s where I need your help.

I found this in the well working compressed code

(function () {
// same stuff here      
})();

requestAnimFrame(O);

which goes like this in the bad working compressed code

B.onload = function () {
// same stuff here
};
requestAnimFrame(O)

So, how exactly can Closure Compiler declare a function without name? And what are those (); at the end of the function declaration? How is this realized in uncompressed code? If it might help, this is how it looks like in the uncompressed bad version (which I hope to fix):

function init() {
// same stuff here
}

B.onload = function(){
start()
}

function start() {
init()
requestAnimFrame(0);
}

If you want to test the difference by yourself, here’s the result when using the good code
and here’s the result when using the bad code

try to click the logo: cubes slips faster in the first link, if you have a good cpu it shouldn’t get killed when running the visuals. The second link, by contrary, seems to overload the cpu and have a different displays when going on in the animation (I can already fix this second problem having spotted the difference in the code and remembered what I changed).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:32:50+00:00Added an answer on June 12, 2026 at 11:32 am

    “So, how exactly can Closure Compiler declare a function without name?”

    Because JavaScript supports anonymous functions. You’ve probably used them quite often when assigning event handlers.

    “And what are those (); at the end of the function declaration?”

    They do the same thing they would after any function. They invoke it. Though it’s not a function “declaration”. Because the function is wrapped in parentheses, it’s an anonymous function expression.

    “How is this realized in uncompressed code?”

    That would depend on the uncompressed code. People use this pattern frequently in their normal code. It creates a local variable scope in which the code can execute.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two different libGL libraries on the same Ubuntu 11.04 machine. One library
I have two different arrays, one with strings and another with ints. I want
I have two different-sized monitors, connected together using (I believe) TwinView. I tried System.out.println(Toolkit.getDefaultToolkit().getScreenSize());
I have two different versions of linux/unix each running cfengine3. Is it possible to
I have php two servers with different versions of php, and am having trouble
I have trees in two different pages, both have lots of other functionality too.
I'm working on trying to have my project automatically build two different versions of
I have two slightly different versions of my VB applications that I would like
I have .NET enterprise application for work with two different versions. A SQL Compact
I have a project with two different versions. I keep two targets in xcode

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.