feat: implement relative import resolution with normalized paths and update all test modules
Replace the flat module name-to-path mapping with a proper relative import resolver that handles "./" and "../" prefixes relative to the importer's directory. This is a breaking change: existing imports in user code that assume paths are relative to the entrypoint file will now fail. Stack trace output and host API calls now use the resolved module string instead of the short import name. Update all test fixtures to use "./" relative imports and adjust C test files to pass the full resolved module path to wrenGetVariable.
This commit is contained in:
@@ -3,7 +3,7 @@ System.print("start a")
|
||||
|
||||
var A = "a value"
|
||||
System.print("a defined %(A)")
|
||||
import "b" for B
|
||||
import "./b" for B
|
||||
System.print("a imported %(B)")
|
||||
|
||||
System.print("end a")
|
||||
|
||||
@@ -3,7 +3,7 @@ System.print("start b")
|
||||
|
||||
var B = "b value"
|
||||
System.print("b defined %(B)")
|
||||
import "a" for A
|
||||
import "./a" for A
|
||||
System.print("b imported %(A)")
|
||||
|
||||
System.print("end b")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import "a"
|
||||
import "./a"
|
||||
|
||||
// Shared module should only run once:
|
||||
// expect: start a
|
||||
|
||||
Reference in New Issue
Block a user