From 7ce0358351d8e241463e744d75e78c4cd810d19f Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Tue, 21 Apr 2020 14:53:55 -0700 Subject: fix #13222: make relativePath more robust and flexible (#13451) * * relativePath(foo) now works * relativePath(rel, abs) and relativePath(abs, rel) now work (fixes #13222) * relativePath, absolutePath, getCurrentDir now available in more targets (eg: vm, nodejs etc) * fix bug: isAbsolutePath now works with -d:js; add tests * workaround https://github.com/nim-lang/Nim/issues/13469 * remove `relativePath(path)` overload for now * add back changelog after rebase --- changelog.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'changelog.md') diff --git a/changelog.md b/changelog.md index 4db405013..fc409c8aa 100644 --- a/changelog.md +++ b/changelog.md @@ -31,6 +31,12 @@ - The file descriptors created for internal bookkeeping by `ioselector_kqueue` and `ioselector_epoll` will no longer be leaked to child processes. +- `relativePath(rel, abs)` and `relativePath(abs, rel)` used to silently give wrong results + (see #13222); instead they now use `getCurrentDir` to resolve those cases, + and this can now throw in edge cases where `getCurrentDir` throws. + `relativePath` also now works for js with `-d:nodejs`. + + ## Language changes - In newruntime it is now allowed to assign discriminator field without restrictions as long as case object doesn't have custom destructor. Discriminator value doesn't have to be a constant either. If you have custom destructor for case object and you do want to freely assign discriminator fields, it is recommended to refactor object into 2 objects like this: ```nim -- cgit 1.4.1-2-gfad0