{"action":"opened","number":1,"pull_request":{"url":"https://api.github.com/repos/tdelmas/nunjucks/pulls/1","id":46613406,"html_url":"https://github.com/tdelmas/nunjucks/pull/1","diff_url":"https://github.com/tdelmas/nunjucks/pull/1.diff","patch_url":"https://github.com/tdelmas/nunjucks/pull/1.patch","issue_url":"https://api.github.com/repos/tdelmas/nunjucks/issues/1","number":1,"state":"open","locked":false,"title":"Bug : you can't test a variable true-ness after an assignment from a macro","user":{"login":"tdelmas","id":1955774,"avatar_url":"https://avatars.githubusercontent.com/u/1955774?v=3","gravatar_id":"","url":"https://api.github.com/users/tdelmas","html_url":"https://github.com/tdelmas","followers_url":"https://api.github.com/users/tdelmas/followers","following_url":"https://api.github.com/users/tdelmas/following{/other_user}","gists_url":"https://api.github.com/users/tdelmas/gists{/gist_id}","starred_url":"https://api.github.com/users/tdelmas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdelmas/subscriptions","organizations_url":"https://api.github.com/users/tdelmas/orgs","repos_url":"https://api.github.com/users/tdelmas/repos","events_url":"https://api.github.com/users/tdelmas/events{/privacy}","received_events_url":"https://api.github.com/users/tdelmas/received_events","type":"User","site_admin":false},"body":"Sorry to not include a fix.\r\n\r\nthe generated code for the **if** of\r\n```\r\n{% set a = macro_that_return_empty_string(...) %}\r\n{% if ( a ) %}\r\n```\r\nis\r\n```\r\nif( runtime.contextOrFrameLookup(context, frame, \"a\") ) {\r\n```\r\nwhich return a SafeString **{ 'val':'','length':0 }** instead of **''** (so the **if** gets always **true**)\r\n\r\nIt works with **{% if ( a != '') %}** because of the toString method on SafeString.\r\n\r\nI think the compiler should produce something like : \r\n```\r\nif( runtime.contextOrFrameLookup(context, frame, \"a\").val ) {\r\n```","created_at":"2015-10-02T08:39:47Z","updated_at":"2015-10-02T08:39:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tdelmas/nunjucks/pulls/1/commits","review_comments_url":"https://api.github.com/repos/tdelmas/nunjucks/pulls/1/comments","review_comment_url":"https://api.github.com/repos/tdelmas/nunjucks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tdelmas/nunjucks/issues/1/comments","statuses_url":"https://api.github.com/repos/tdelmas/nunjucks/statuses/13ddab12055380d1c235a67ccbd073e6a19851da","head":{"label":"tdelmas:tdelmas-bug-1","ref":"tdelmas-bug-1","sha":"13ddab12055380d1c235a67ccbd073e6a19851da","user":{"login":"tdelmas","id":1955774,"avatar_url":"https://avatars.githubusercontent.com/u/1955774?v=3","gravatar_id":"","url":"https://api.github.com/users/tdelmas","html_url":"https://github.com/tdelmas","followers_url":"https://api.github.com/users/tdelmas/followers","following_url":"https://api.github.com/users/tdelmas/following{/other_user}","gists_url":"https://api.github.com/users/tdelmas/gists{/gist_id}","starred_url":"https://api.github.com/users/tdelmas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdelmas/subscriptions","organizations_url":"https://api.github.com/users/tdelmas/orgs","repos_url":"https://api.github.com/users/tdelmas/repos","events_url":"https://api.github.com/users/tdelmas/events{/privacy}","received_events_url":"https://api.github.com/users/tdelmas/received_events","type":"User","site_admin":false},"repo":{"id":43510002,"name":"nunjucks","full_name":"tdelmas/nunjucks","owner":{"login":"tdelmas","id":1955774,"avatar_url":"https://avatars.githubusercontent.com/u/1955774?v=3","gravatar_id":"","url":"https://api.github.com/users/tdelmas","html_url":"https://github.com/tdelmas","followers_url":"https://api.github.com/users/tdelmas/followers","following_url":"https://api.github.com/users/tdelmas/following{/other_user}","gists_url":"https://api.github.com/users/tdelmas/gists{/gist_id}","starred_url":"https://api.github.com/users/tdelmas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdelmas/subscriptions","organizations_url":"https://api.github.com/users/tdelmas/orgs","repos_url":"https://api.github.com/users/tdelmas/repos","events_url":"https://api.github.com/users/tdelmas/events{/privacy}","received_events_url":"https://api.github.com/users/tdelmas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tdelmas/nunjucks","description":"A powerful templating engine with inheritance, asynchronous control, and more (jinja2 inspired)","fork":true,"url":"https://api.github.com/repos/tdelmas/nunjucks","forks_url":"https://api.github.com/repos/tdelmas/nunjucks/forks","keys_url":"https://api.github.com/repos/tdelmas/nunjucks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tdelmas/nunjucks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tdelmas/nunjucks/teams","hooks_url":"https://api.github.com/repos/tdelmas/nunjucks/hooks","issue_events_url":"https://api.github.com/repos/tdelmas/nunjucks/issues/events{/number}","events_url":"https://api.github.com/repos/tdelmas/nunjucks/events","assignees_url":"https://api.github.com/repos/tdelmas/nunjucks/assignees{/user}","branches_url":"https://api.github.com/repos/tdelmas/nunjucks/branches{/branch}","tags_url":"https://api.github.com/repos/tdelmas/nunjucks/tags","blobs_url":"https://api.github.com/repos/tdelmas/nunjucks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tdelmas/nunjucks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tdelmas/nunjucks/git/refs{/sha}","trees_url":"https://api.github.com/repos/tdelmas/nunjucks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tdelmas/nunjucks/statuses/{sha}","languages_url":"https://api.github.com/repos/tdelmas/nunjucks/languages","stargazers_url":"https://api.github.com/repos/tdelmas/nunjucks/stargazers","contributors_url":"https://api.github.com/repos/tdelmas/nunjucks/contributors","subscribers_url":"https://api.github.com/repos/tdelmas/nunjucks/subscribers","subscription_url":"https://api.github.com/repos/tdelmas/nunjucks/subscription","commits_url":"https://api.github.com/repos/tdelmas/nunjucks/commits{/sha}","git_commits_url":"https://api.github.com/repos/tdelmas/nunjucks/git/commits{/sha}","comments_url":"https://api.github.com/repos/tdelmas/nunjucks/comments{/number}","issue_comment_url":"https://api.github.com/repos/tdelmas/nunjucks/issues/comments{/number}","contents_url":"https://api.github.com/repos/tdelmas/nunjucks/contents/{+path}","compare_url":"https://api.github.com/repos/tdelmas/nunjucks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tdelmas/nunjucks/merges","archive_url":"https://api.github.com/repos/tdelmas/nunjucks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tdelmas/nunjucks/downloads","issues_url":"https://api.github.com/repos/tdelmas/nunjucks/issues{/number}","pulls_url":"https://api.github.com/repos/tdelmas/nunjucks/pulls{/number}","milestones_url":"https://api.github.com/repos/tdelmas/nunjucks/milestones{/number}","notifications_url":"https://api.github.com/repos/tdelmas/nunjucks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tdelmas/nunjucks/labels{/name}","releases_url":"https://api.github.com/repos/tdelmas/nunjucks/releases{/id}","created_at":"2015-10-01T17:21:21Z","updated_at":"2015-10-01T17:21:22Z","pushed_at":"2015-10-02T08:39:47Z","git_url":"git://github.com/tdelmas/nunjucks.git","ssh_url":"git@github.com:tdelmas/nunjucks.git","clone_url":"https://github.com/tdelmas/nunjucks.git","svn_url":"https://github.com/tdelmas/nunjucks","homepage":"http://mozilla.github.io/nunjucks/","size":7456,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"tdelmas:master","ref":"master","sha":"b638d15630dd345b0b12fa78dcbc26a0b4f1caad","user":{"login":"tdelmas","id":1955774,"avatar_url":"https://avatars.githubusercontent.com/u/1955774?v=3","gravatar_id":"","url":"https://api.github.com/users/tdelmas","html_url":"https://github.com/tdelmas","followers_url":"https://api.github.com/users/tdelmas/followers","following_url":"https://api.github.com/users/tdelmas/following{/other_user}","gists_url":"https://api.github.com/users/tdelmas/gists{/gist_id}","starred_url":"https://api.github.com/users/tdelmas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdelmas/subscriptions","organizations_url":"https://api.github.com/users/tdelmas/orgs","repos_url":"https://api.github.com/users/tdelmas/repos","events_url":"https://api.github.com/users/tdelmas/events{/privacy}","received_events_url":"https://api.github.com/users/tdelmas/received_events","type":"User","site_admin":false},"repo":{"id":43510002,"name":"nunjucks","full_name":"tdelmas/nunjucks","owner":{"login":"tdelmas","id":1955774,"avatar_url":"https://avatars.githubusercontent.com/u/1955774?v=3","gravatar_id":"","url":"https://api.github.com/users/tdelmas","html_url":"https://github.com/tdelmas","followers_url":"https://api.github.com/users/tdelmas/followers","following_url":"https://api.github.com/users/tdelmas/following{/other_user}","gists_url":"https://api.github.com/users/tdelmas/gists{/gist_id}","starred_url":"https://api.github.com/users/tdelmas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdelmas/subscriptions","organizations_url":"https://api.github.com/users/tdelmas/orgs","repos_url":"https://api.github.com/users/tdelmas/repos","events_url":"https://api.github.com/users/tdelmas/events{/privacy}","received_events_url":"https://api.github.com/users/tdelmas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tdelmas/nunjucks","description":"A powerful templating engine with inheritance, asynchronous control, and more (jinja2 inspired)","fork":true,"url":"https://api.github.com/repos/tdelmas/nunjucks","forks_url":"https://api.github.com/repos/tdelmas/nunjucks/forks","keys_url":"https://api.github.com/repos/tdelmas/nunjucks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tdelmas/nunjucks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tdelmas/nunjucks/teams","hooks_url":"https://api.github.com/repos/tdelmas/nunjucks/hooks","issue_events_url":"https://api.github.com/repos/tdelmas/nunjucks/issues/events{/number}","events_url":"https://api.github.com/repos/tdelmas/nunjucks/events","assignees_url":"https://api.github.com/repos/tdelmas/nunjucks/assignees{/user}","branches_url":"https://api.github.com/repos/tdelmas/nunjucks/branches{/branch}","tags_url":"https://api.github.com/repos/tdelmas/nunjucks/tags","blobs_url":"https://api.github.com/repos/tdelmas/nunjucks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tdelmas/nunjucks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tdelmas/nunjucks/git/refs{/sha}","trees_url":"https://api.github.com/repos/tdelmas/nunjucks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tdelmas/nunjucks/statuses/{sha}","languages_url":"https://api.github.com/repos/tdelmas/nunjucks/languages","stargazers_url":"https://api.github.com/repos/tdelmas/nunjucks/stargazers","contributors_url":"https://api.github.com/repos/tdelmas/nunjucks/contributors","subscribers_url":"https://api.github.com/repos/tdelmas/nunjucks/subscribers","subscription_url":"https://api.github.com/repos/tdelmas/nunjucks/subscription","commits_url":"https://api.github.com/repos/tdelmas/nunjucks/commits{/sha}","git_commits_url":"https://api.github.com/repos/tdelmas/nunjucks/git/commits{/sha}","comments_url":"https://api.github.com/repos/tdelmas/nunjucks/comments{/number}","issue_comment_url":"https://api.github.com/repos/tdelmas/nunjucks/issues/comments{/number}","contents_url":"https://api.github.com/repos/tdelmas/nunjucks/contents/{+path}","compare_url":"https://api.github.com/repos/tdelmas/nunjucks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tdelmas/nunjucks/merges","archive_url":"https://api.github.com/repos/tdelmas/nunjucks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tdelmas/nunjucks/downloads","issues_url":"https://api.github.com/repos/tdelmas/nunjucks/issues{/number}","pulls_url":"https://api.github.com/repos/tdelmas/nunjucks/pulls{/number}","milestones_url":"https://api.github.com/repos/tdelmas/nunjucks/milestones{/number}","notifications_url":"https://api.github.com/repos/tdelmas/nunjucks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tdelmas/nunjucks/labels{/name}","releases_url":"https://api.github.com/repos/tdelmas/nunjucks/releases{/id}","created_at":"2015-10-01T17:21:21Z","updated_at":"2015-10-01T17:21:22Z","pushed_at":"2015-10-02T08:39:47Z","git_url":"git://github.com/tdelmas/nunjucks.git","ssh_url":"git@github.com:tdelmas/nunjucks.git","clone_url":"https://github.com/tdelmas/nunjucks.git","svn_url":"https://github.com/tdelmas/nunjucks","homepage":"http://mozilla.github.io/nunjucks/","size":7456,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tdelmas/nunjucks/pulls/1"},"html":{"href":"https://github.com/tdelmas/nunjucks/pull/1"},"issue":{"href":"https://api.github.com/repos/tdelmas/nunjucks/issues/1"},"comments":{"href":"https://api.github.com/repos/tdelmas/nunjucks/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/tdelmas/nunjucks/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/tdelmas/nunjucks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tdelmas/nunjucks/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/tdelmas/nunjucks/statuses/13ddab12055380d1c235a67ccbd073e6a19851da"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":10,"deletions":0,"changed_files":1}}