fix import resolving issue with absolute paths
This commit is contained in:
parent
bf591d595a
commit
ab811a0d0b
2 changed files with 9 additions and 1 deletions
|
@ -25,7 +25,12 @@ describe('tests', function() {
|
|||
|
||||
it('should resolve stdlib module', function() {
|
||||
assert.doesNotThrow(() => {
|
||||
const code = 'import "hashes/sha256/512bit" as sha256\ndef main() -> (): return';
|
||||
const code = `
|
||||
import "hashes/sha256/512bit" as sha256
|
||||
import "ecc/edwardsAdd" as edwardsAdd
|
||||
def main() -> ():
|
||||
return
|
||||
`;
|
||||
this.zokrates.compile(code, "main");
|
||||
})
|
||||
});
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
const getAbsolutePath = (basePath, relativePath) => {
|
||||
if (relativePath[0] !== '.') {
|
||||
return relativePath;
|
||||
}
|
||||
var stack = basePath.split('/');
|
||||
var chunks = relativePath.split('/');
|
||||
stack.pop();
|
||||
|
|
Loading…
Reference in a new issue