Fix resolution of relative paths which were off by one component.
For instance, if current module ID was `foo/bar` and the module require()'d
`./quux`, this would be incorrectly resolved to `foo/bar/quux` instead of the
expected `foo/quux`.
Testcases were testing for the wrong behavior - they are also fixed by this
commit. A specific bug testcase was also added for the particular issue
found by andoma.
Technically this should probably not be necessary: Duktape module loader
is a fully own implementation based on the CommonJS module loading
specification. The specification is not shipped with the distributable,
just the master repo. But it's perhaps best to mention it in the README
still.
Make the `tracedata` property of error objects an internal property to
make sandboxing easier. Tracedata contains function references to functions
in the current call stack, which may be problematic in some sandboxing
environments: sandboxed code may more easily gain access to functions not
explicitly exposed to it through the sandboxed global object.
The tracedata contains function references to functions in the current
call stack. If these functions are not accessible from a sandboxed
environment (through the global object), sandboxed code may gain access
to functions it's not intended to have access to.
Before this fix, both DUK_F_GCC and DUK_F_CLANG would be defined when
compiling with clang. This might have had an impact on the #ifdef
ladders in duk_features.h.in so that this change may have some side
effects for clang.