Description
When using the code below the logged value is set incorrectly to '/sub.js', it should be /'index.js'. In 5.4.0.GA the code returned the value 'index', although this value is different to the expected value, because it no longer refers to the correct file I am labeling this a *regression*
Removing
require('./sub.js')
makes the issue disappear so the error is probably caused by that require. This can also be confirmed by doing
var filename = __filename
before the require and then setting the filename property to this variable.
var test = require('./index');
console.log(test.filename);
var sub = require('./sub');
module.exports = {
filename: __filename,
name: 'index.js',
sub: sub.name
};
module.exports = {
name: 'sub.js',
};
Steps to reproduce
Actual result
Logging is '/sub.js'
Expected result
The logging should be '/index.js'
https://github.com/appcelerator/titanium_mobile_windows/pull/864
Verified using: OS: Microsoft Windows 10 Pro 10.0.14393 Appc core: 6.0.0-42 Appc NPM: 4.2.8-6 Ti SDK: 6.0.0.v20160909225457 __filename now returns correct value Closing ticket