{"action":"opened","issue":{"url":"https://api.github.com/repos/terser-js/terser/issues/182","repository_url":"https://api.github.com/repos/terser-js/terser","labels_url":"https://api.github.com/repos/terser-js/terser/issues/182/labels{/name}","comments_url":"https://api.github.com/repos/terser-js/terser/issues/182/comments","events_url":"https://api.github.com/repos/terser-js/terser/issues/182/events","html_url":"https://github.com/terser-js/terser/issues/182","id":386448989,"node_id":"MDU6SXNzdWUzODY0NDg5ODk=","number":182,"title":"Why is `Boolean(foo)` not replaced with `!!foo` ?","user":{"login":"laruiss","id":2486424,"node_id":"MDQ6VXNlcjI0ODY0MjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2486424?v=4","gravatar_id":"","url":"https://api.github.com/users/laruiss","html_url":"https://github.com/laruiss","followers_url":"https://api.github.com/users/laruiss/followers","following_url":"https://api.github.com/users/laruiss/following{/other_user}","gists_url":"https://api.github.com/users/laruiss/gists{/gist_id}","starred_url":"https://api.github.com/users/laruiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laruiss/subscriptions","organizations_url":"https://api.github.com/users/laruiss/orgs","repos_url":"https://api.github.com/users/laruiss/repos","events_url":"https://api.github.com/users/laruiss/events{/privacy}","received_events_url":"https://api.github.com/users/laruiss/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-01T11:16:06Z","updated_at":"2018-12-01T11:16:06Z","closed_at":null,"author_association":"NONE","body":"**Question**\r\n\r\nHi, I was wondering why `Boolean(foo)` was not converted to `!!foo`. Is it a choice?\r\nThe same goes with `Number(bar)`, why not convert it to `+bar` ?\r\n\r\nterser 3.10.13\r\n\r\n```\r\nconst terser = require('terser')\r\n\r\nvar code = \"const foo = Boolean(bar)\";\r\nvar result = terser.minify(code);\r\n\r\nconsole.log(result)\r\n```\r\n\r\n**`terser` input**\r\n\r\n`const foo = Boolean(bar)`\r\n\r\n**`terser` output or error**\r\n\r\n`const foo=Boolean(bar);`\r\n\r\n**Expected result**\r\n\r\n`const foo=!!bar`"}}
{"actor":{"display_login":"laruiss"}}