{"action":"opened","issue":{"url":"https://api.github.com/repos/macbre/phantomas/issues/563","labels_url":"https://api.github.com/repos/macbre/phantomas/issues/563/labels{/name}","comments_url":"https://api.github.com/repos/macbre/phantomas/issues/563/comments","events_url":"https://api.github.com/repos/macbre/phantomas/issues/563/events","html_url":"https://github.com/macbre/phantomas/issues/563","id":110434109,"number":563,"title":"phantomas shouldn't modify the `options` parameter","user":{"login":"tillsc","id":311544,"avatar_url":"https://avatars.githubusercontent.com/u/311544?v=3","gravatar_id":"","url":"https://api.github.com/users/tillsc","html_url":"https://github.com/tillsc","followers_url":"https://api.github.com/users/tillsc/followers","following_url":"https://api.github.com/users/tillsc/following{/other_user}","gists_url":"https://api.github.com/users/tillsc/gists{/gist_id}","starred_url":"https://api.github.com/users/tillsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tillsc/subscriptions","organizations_url":"https://api.github.com/users/tillsc/orgs","repos_url":"https://api.github.com/users/tillsc/repos","events_url":"https://api.github.com/users/tillsc/events{/privacy}","received_events_url":"https://api.github.com/users/tillsc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-08T12:03:36Z","updated_at":"2015-10-08T12:03:36Z","closed_at":null,"body":"I struggled a while with this:\r\n\r\n    https://github.com/macbre/phantomas/blob/devel/lib/index.js#L53\r\n\r\nI ran multiple tests against different URIs. But it was always the first URIs which was actually used.\r\n\r\nConsider this code:\r\n\r\n~~~javascript\r\nvar options = {timeout: 10};\r\n\r\nphantomas('https://www.google.de/', options, ...); // Will work as expected\r\nphantomas('https://www.yahoo.com/', options, ...); // Will run against google again\r\n~~~\r\n\r\nThis could be avoided if the `url` parameter would have precedence over `options.url`. Another option would be not to modify the options object itself and just to clone it."}}