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

Can't reference classes #81

Open
hopewise opened this issue May 29, 2019 · 4 comments
Open

Can't reference classes #81

hopewise opened this issue May 29, 2019 · 4 comments

Comments

@hopewise
Copy link

it seems that hscript interpreter could not recognize my classes if I used them into script.

ex: I used my classMain , I got error when tried to execute:

js__$Boot_HaxeError {val: {…}, stack: "Error: EUnknownVariable(Main)↵    at hscript_Inter

I used to import my class Main at the same place where I execute the script.

I also, tried to use the full package name to reference the Main class com.clientside.main.Main, I got error:

v: "com"
__enum__: "hscript.Error"
stack: Error: EUnknownVariable(com)

Any idea?

@ncannasse
Copy link
Member

You must share the class explicitely with variables.set("Main", Main)

@hopewise
Copy link
Author

I am already doing so, actually, but I still get the same error..

@hopewise hopewise reopened this May 29, 2019
@ncannasse
Copy link
Member

That must be an error on your side, as EUnkownVariable is only throw is the key does not exists in variables Map

@hopewise
Copy link
Author

hopewise commented Jun 2, 2019

I have created a minimal sample app to show my problem, please bear with me as I am showing the library StablexUI which uses hscript at here
I have successfully registered some types as here however, I could not register my own classes

why my classes are not registrable?
I hope you can have a look at this minimal sample app, thank you

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

2 participants