Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

//#include /xxx.js initialization order is wrong. #149

Open
roro4ever opened this issue Oct 18, 2023 · 0 comments
Open

//#include /xxx.js initialization order is wrong. #149

roro4ever opened this issue Oct 18, 2023 · 0 comments

Comments

@roro4ever
Copy link

Information we need from you if you want to have something fixed:

OrionUO is a great tool for someone who want to control almost everything in uo. For me, it provides a good chance to learn about javascript. So,Thank you very much.
But, When I use the include system, there are some problem about static object initialization order problem -- the included module initialized later than the caller module.

  • Add a link to the server you're playing on.
  • If this is your local server: provide a link to emulator you're using and provide a link to client files you're using.
  • If this is a closed private shard: provide us with info in a personal message to Aimed

not relative with shard.

  • Describe the bug and add a screenshot ( or a gif/mp4 ) from EA's classic 2d client and from Orion client.
    http://https://gyazo.com is a very nice tool for this.
//For example , We have 2 modules: common.js  and A.js. Common.js stores many public variable and function. A.js uses them.
// Code like below:

/*
some literal object created in common.js.
*/

var commonObj = {
a: 1, 
b: 2
};

/*
some object created in A.js.
*/

//#include /common.js

var myObj = {
c:3, 
__proto__: commonObj
};

function AutoStart(){
...
  dosomething(myObj);
}

In run time, myObj__proto__ is undefine. because common.js will append A.js in execution order.

I have tried to use import/export, but the javascript engine is too old(compiled in 2011), it does not support ES6...

How can I solve this problem. Thanks.

  • After you've done how to repeat actions and triggered the bug, close the client and look for uolog.txt in a folder where you have OrionUO.exe and upload it in your thread.
  • If your uolog.txt is too big, you probably had a long client session. Just restart Orion client and do how to steps again, close the client and upload a smaller version of your uolog.txt.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant