ialex32x / unity-jsb

It brings Javascript runtime capability to Unity3D by integrating QuickJS.
MIT License
337 stars 43 forks source link

PathBasedModuleResolver.ResolveModule return wrong result when parent_module_id is an absolute path. #57

Closed jo32 closed 3 years ago

jo32 commented 3 years ago

https://github.com/ialex32x/unity-jsb/blob/master/Assets/jsb/Source/Module/PathBasedModuleResolver.cs#L39

parent_module_id: "/Users/.../example_monobehaviour.js" module_id: ./runtime/class_decorators => resolving: Users/.../runtime/class_decorators

which should be: /Users/.../runtime/class_decorators

You probably can reproduce this error by adding search path mannually by calling:

pathResolver.AddSearchPath("/Users/.../");

ialex32x commented 3 years ago

Yes, it's a bug of ExtractPath. I fixed it in the latest submission. Thank you very much.

jo32 commented 3 years ago

fixed