{"action":"created","issue":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4643","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4643/labels{/name}","comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4643/comments","events_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4643/events","html_url":"https://github.com/HaxeFoundation/haxe/issues/4643","id":116921577,"number":4643,"title":"on cpp, if (!someArray) is true while it's false on js","user":{"login":"vroad","id":396351,"avatar_url":"https://avatars.githubusercontent.com/u/396351?v=3","gravatar_id":"","url":"https://api.github.com/users/vroad","html_url":"https://github.com/vroad","followers_url":"https://api.github.com/users/vroad/followers","following_url":"https://api.github.com/users/vroad/following{/other_user}","gists_url":"https://api.github.com/users/vroad/gists{/gist_id}","starred_url":"https://api.github.com/users/vroad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vroad/subscriptions","organizations_url":"https://api.github.com/users/vroad/orgs","repos_url":"https://api.github.com/users/vroad/repos","events_url":"https://api.github.com/users/vroad/events{/privacy}","received_events_url":"https://api.github.com/users/vroad/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-14T12:14:01Z","updated_at":"2015-11-14T13:21:47Z","closed_at":"2015-11-14T13:21:47Z","body":"If I treat some array as a Bool value and do condition check, cpp and js gives me different result.\r\nI understand that it's bad to use expression like (!data) on Haxe, but why the result becomes different on each target?\r\nOn cpp ```(!data)``` becomes true somehow.\r\n\r\n```Haxe\r\nclass Test {\r\n    static function main() {\r\n        var data:Dynamic = [\"Some string\"];\r\n        if (!data)\r\n            trace(\"(!data) == true\");\r\n        else\r\n            trace(\"(!data) == false\");\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/comments/156696423","html_url":"https://github.com/HaxeFoundation/haxe/issues/4643#issuecomment-156696423","issue_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4643","id":156696423,"user":{"login":"ncannasse","id":1022912,"avatar_url":"https://avatars.githubusercontent.com/u/1022912?v=3","gravatar_id":"","url":"https://api.github.com/users/ncannasse","html_url":"https://github.com/ncannasse","followers_url":"https://api.github.com/users/ncannasse/followers","following_url":"https://api.github.com/users/ncannasse/following{/other_user}","gists_url":"https://api.github.com/users/ncannasse/gists{/gist_id}","starred_url":"https://api.github.com/users/ncannasse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncannasse/subscriptions","organizations_url":"https://api.github.com/users/ncannasse/orgs","repos_url":"https://api.github.com/users/ncannasse/repos","events_url":"https://api.github.com/users/ncannasse/events{/privacy}","received_events_url":"https://api.github.com/users/ncannasse/received_events","type":"User","site_admin":false},"created_at":"2015-11-14T13:21:47Z","updated_at":"2015-11-14T13:21:47Z","body":"! works only on actual Bool values in Haxe. When using a Dynamic which is not a Bool, the result is unspecified."}}