any planed module loader?

cocos2d jsb implemented a require function to connec js files in the project.
require is simply to find and execute the script. But this can be very dangerous for large project with many js files.

  1. if you require a file twice the script is executed twice. You need to add some flag the prevent the code from executing the second time.
  2. It’s very easy to override global variables defined in other files.

So my advice is to implement a require function like Node.js did.

1 Like