{ "id": "163050", "key": "TIMOB-23875", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-09-09T21:43:44.000+0000", "created": "2016-09-07T15:34:01.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "qe-6.0.0", "regression" ], "versions": [ { "id": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "issuelinks": [], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-09-12T11:08:49.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "h5.Description\r\n\r\nWhen 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*\r\n\r\nRemoving {{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.\r\n\r\n{code: title=app.js}\r\n\r\nvar test = require('./index');\r\nconsole.log(test.filename);\r\n{code}\r\n\r\n{code: title=index.js}\r\nvar sub = require('./sub');\r\nmodule.exports = {\r\n filename: __filename,\r\n name: 'index.js',\r\n sub: sub.name\r\n};\r\n{code}\r\n\r\n{code: title=sub.js}\r\nmodule.exports = {\r\n name: 'sub.js',\r\n};\r\n{code}\r\n\r\nh5.Steps to reproduce\r\n\r\nh5.Actual result\r\n\r\nLogging is '/sub.js'\r\n\r\nh5.Expected result\r\n\r\nThe logging should be '/index.js'", "attachment": [], "flagged": false, "summary": "Windows: Incorrect __filename value", "creator": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "subtasks": [], "reporter": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "environment": "OS: Microsoft Windows 10 Pro 10.0.14393\r\nAppc core: 6.0.0-38\r\nAppc NPM: 4.2.8-6\r\nTi SDK: 6.0.0.v20160906221416", "closedSprints": [ { "id": 704, "state": "closed", "name": "2016 Sprint 18 SDK", "startDate": "2016-08-27T00:18:36.960Z", "endDate": "2016-09-10T00:18:00.000Z", "completeDate": "2016-09-09T20:26:13.865Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "395646", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile_windows/pull/864", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-09-09T03:53:17.000+0000", "updated": "2016-09-09T03:53:17.000+0000" }, { "id": "395880", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Verified using:\r\n\r\nOS: Microsoft Windows 10 Pro 10.0.14393\r\nAppc core: 6.0.0-42\r\nAppc NPM: 4.2.8-6\r\nTi SDK: 6.0.0.v20160909225457\r\n\r\n__filename now returns correct value\r\n\r\nClosing ticket", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2016-09-12T11:08:40.000+0000", "updated": "2016-09-12T11:08:40.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }