{"action":"created","comment":{"url":"https://api.github.com/repos/bem/bem-xjst/pulls/comments/77529391","id":77529391,"diff_hunk":"@@ -64,12 +68,16 @@ Compiler.prototype.compile = function compile(code, options) {\n   if (!options) options = {};\n \n   var out = this.generate(code, options);\n+\n   out = '(function(exports, console) {' + out + '})';\n   var exports = {};\n \n   var fn = options.context === 'this' ?\n     vm.runInThisContext(out) :\n-    vm.runInNewContext(out, { Error: Error, BEMXJSTError: BEMXJSTError });\n+    vm.runInNewContext(out, {\n+      console: console,\n+      Error: Error,\n+      BEMXJSTError: BEMXJSTError });","path":"lib/compiler.js","position":25,"original_position":25,"commit_id":"30ee948baf7d1c48fccd0efbc0e76e3bb3e5fff3","original_commit_id":"30ee948baf7d1c48fccd0efbc0e76e3bb3e5fff3","user":{"login":"zxqfox","id":677518,"avatar_url":"https://avatars.githubusercontent.com/u/677518?v=3","gravatar_id":"","url":"https://api.github.com/users/zxqfox","html_url":"https://github.com/zxqfox","followers_url":"https://api.github.com/users/zxqfox/followers","following_url":"https://api.github.com/users/zxqfox/following{/other_user}","gists_url":"https://api.github.com/users/zxqfox/gists{/gist_id}","starred_url":"https://api.github.com/users/zxqfox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zxqfox/subscriptions","organizations_url":"https://api.github.com/users/zxqfox/orgs","repos_url":"https://api.github.com/users/zxqfox/repos","events_url":"https://api.github.com/users/zxqfox/events{/privacy}","received_events_url":"https://api.github.com/users/zxqfox/received_events","type":"User","site_admin":false},"body":"Если NewContext нужен только для прокидывания переменных, то это можно переделать в thisContext, чем ускорить.\r\nТехника такая:\r\n```\r\nvm.runInThisContext(`function(console, Error, BEMXJSTError){ ${out} }`).call(this, console, Error, BEMXJSTError);\r\n```","created_at":"2016-09-05T14:25:33Z","updated_at":"2016-09-05T14:25:33Z","html_url":"https://github.com/bem/bem-xjst/pull/342#discussion_r77529391","pull_request_url":"https://api.github.com/repos/bem/bem-xjst/pulls/342","_links":{"self":{"href":"https://api.github.com/repos/bem/bem-xjst/pulls/comments/77529391"},"html":{"href":"https://github.com/bem/bem-xjst/pull/342#discussion_r77529391"},"pull_request":{"href":"https://api.github.com/repos/bem/bem-xjst/pulls/342"}}},"pull_request":{"url":"https://api.github.com/repos/bem/bem-xjst/pulls/342","id":83998646,"html_url":"https://github.com/bem/bem-xjst/pull/342","diff_url":"https://github.com/bem/bem-xjst/pull/342.diff","patch_url":"https://github.com/bem/bem-xjst/pull/342.patch","issue_url":"https://api.github.com/repos/bem/bem-xjst/issues/342","number":342,"state":"open","locked":false,"title":"Runtime linter","user":{"login":"miripiruni","id":144537,"avatar_url":"https://avatars.githubusercontent.com/u/144537?v=3","gravatar_id":"","url":"https://api.github.com/users/miripiruni","html_url":"https://github.com/miripiruni","followers_url":"https://api.github.com/users/miripiruni/followers","following_url":"https://api.github.com/users/miripiruni/following{/other_user}","gists_url":"https://api.github.com/users/miripiruni/gists{/gist_id}","starred_url":"https://api.github.com/users/miripiruni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miripiruni/subscriptions","organizations_url":"https://api.github.com/users/miripiruni/orgs","repos_url":"https://api.github.com/users/miripiruni/repos","events_url":"https://api.github.com/users/miripiruni/events{/privacy}","received_events_url":"https://api.github.com/users/miripiruni/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-05T12:58:23Z","updated_at":"2016-09-05T14:25:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"118e63094b0ef09608164fda7961d45f54f09fc7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/bem/bem-xjst/pulls/342/commits","review_comments_url":"https://api.github.com/repos/bem/bem-xjst/pulls/342/comments","review_comment_url":"https://api.github.com/repos/bem/bem-xjst/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bem/bem-xjst/issues/342/comments","statuses_url":"https://api.github.com/repos/bem/bem-xjst/statuses/30ee948baf7d1c48fccd0efbc0e76e3bb3e5fff3","head":{"label":"bem:runtime-assertions","ref":"runtime-assertions","sha":"30ee948baf7d1c48fccd0efbc0e76e3bb3e5fff3","user":{"login":"bem","id":223412,"avatar_url":"https://avatars.githubusercontent.com/u/223412?v=3","gravatar_id":"","url":"https://api.github.com/users/bem","html_url":"https://github.com/bem","followers_url":"https://api.github.com/users/bem/followers","following_url":"https://api.github.com/users/bem/following{/other_user}","gists_url":"https://api.github.com/users/bem/gists{/gist_id}","starred_url":"https://api.github.com/users/bem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bem/subscriptions","organizations_url":"https://api.github.com/users/bem/orgs","repos_url":"https://api.github.com/users/bem/repos","events_url":"https://api.github.com/users/bem/events{/privacy}","received_events_url":"https://api.github.com/users/bem/received_events","type":"Organization","site_admin":false},"repo":{"id":10028367,"name":"bem-xjst","full_name":"bem/bem-xjst","owner":{"login":"bem","id":223412,"avatar_url":"https://avatars.githubusercontent.com/u/223412?v=3","gravatar_id":"","url":"https://api.github.com/users/bem","html_url":"https://github.com/bem","followers_url":"https://api.github.com/users/bem/followers","following_url":"https://api.github.com/users/bem/following{/other_user}","gists_url":"https://api.github.com/users/bem/gists{/gist_id}","starred_url":"https://api.github.com/users/bem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bem/subscriptions","organizations_url":"https://api.github.com/users/bem/orgs","repos_url":"https://api.github.com/users/bem/repos","events_url":"https://api.github.com/users/bem/events{/privacy}","received_events_url":"https://api.github.com/users/bem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bem/bem-xjst","description":"Declarative template engine for the browser and server","fork":false,"url":"https://api.github.com/repos/bem/bem-xjst","forks_url":"https://api.github.com/repos/bem/bem-xjst/forks","keys_url":"https://api.github.com/repos/bem/bem-xjst/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bem/bem-xjst/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bem/bem-xjst/teams","hooks_url":"https://api.github.com/repos/bem/bem-xjst/hooks","issue_events_url":"https://api.github.com/repos/bem/bem-xjst/issues/events{/number}","events_url":"https://api.github.com/repos/bem/bem-xjst/events","assignees_url":"https://api.github.com/repos/bem/bem-xjst/assignees{/user}","branches_url":"https://api.github.com/repos/bem/bem-xjst/branches{/branch}","tags_url":"https://api.github.com/repos/bem/bem-xjst/tags","blobs_url":"https://api.github.com/repos/bem/bem-xjst/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bem/bem-xjst/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bem/bem-xjst/git/refs{/sha}","trees_url":"https://api.github.com/repos/bem/bem-xjst/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bem/bem-xjst/statuses/{sha}","languages_url":"https://api.github.com/repos/bem/bem-xjst/languages","stargazers_url":"https://api.github.com/repos/bem/bem-xjst/stargazers","contributors_url":"https://api.github.com/repos/bem/bem-xjst/contributors","subscribers_url":"https://api.github.com/repos/bem/bem-xjst/subscribers","subscription_url":"https://api.github.com/repos/bem/bem-xjst/subscription","commits_url":"https://api.github.com/repos/bem/bem-xjst/commits{/sha}","git_commits_url":"https://api.github.com/repos/bem/bem-xjst/git/commits{/sha}","comments_url":"https://api.github.com/repos/bem/bem-xjst/comments{/number}","issue_comment_url":"https://api.github.com/repos/bem/bem-xjst/issues/comments{/number}","contents_url":"https://api.github.com/repos/bem/bem-xjst/contents/{+path}","compare_url":"https://api.github.com/repos/bem/bem-xjst/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bem/bem-xjst/merges","archive_url":"https://api.github.com/repos/bem/bem-xjst/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bem/bem-xjst/downloads","issues_url":"https://api.github.com/repos/bem/bem-xjst/issues{/number}","pulls_url":"https://api.github.com/repos/bem/bem-xjst/pulls{/number}","milestones_url":"https://api.github.com/repos/bem/bem-xjst/milestones{/number}","notifications_url":"https://api.github.com/repos/bem/bem-xjst/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bem/bem-xjst/labels{/name}","releases_url":"https://api.github.com/repos/bem/bem-xjst/releases{/id}","deployments_url":"https://api.github.com/repos/bem/bem-xjst/deployments","created_at":"2013-05-13T09:22:05Z","updated_at":"2016-09-01T15:14:43Z","pushed_at":"2016-09-05T13:08:12Z","git_url":"git://github.com/bem/bem-xjst.git","ssh_url":"git@github.com:bem/bem-xjst.git","clone_url":"https://github.com/bem/bem-xjst.git","svn_url":"https://github.com/bem/bem-xjst","homepage":"https://bem.github.io/bem-xjst","size":1513,"stargazers_count":77,"watchers_count":77,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":27,"mirror_url":null,"open_issues_count":68,"forks":27,"open_issues":68,"watchers":77,"default_branch":"master"}},"base":{"label":"bem:master","ref":"master","sha":"d53646f2c340b5496fbd75a5313e3284b58e238d","user":{"login":"bem","id":223412,"avatar_url":"https://avatars.githubusercontent.com/u/223412?v=3","gravatar_id":"","url":"https://api.github.com/users/bem","html_url":"https://github.com/bem","followers_url":"https://api.github.com/users/bem/followers","following_url":"https://api.github.com/users/bem/following{/other_user}","gists_url":"https://api.github.com/users/bem/gists{/gist_id}","starred_url":"https://api.github.com/users/bem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bem/subscriptions","organizations_url":"https://api.github.com/users/bem/orgs","repos_url":"https://api.github.com/users/bem/repos","events_url":"https://api.github.com/users/bem/events{/privacy}","received_events_url":"https://api.github.com/users/bem/received_events","type":"Organization","site_admin":false},"repo":{"id":10028367,"name":"bem-xjst","full_name":"bem/bem-xjst","owner":{"login":"bem","id":223412,"avatar_url":"https://avatars.githubusercontent.com/u/223412?v=3","gravatar_id":"","url":"https://api.github.com/users/bem","html_url":"https://github.com/bem","followers_url":"https://api.github.com/users/bem/followers","following_url":"https://api.github.com/users/bem/following{/other_user}","gists_url":"https://api.github.com/users/bem/gists{/gist_id}","starred_url":"https://api.github.com/users/bem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bem/subscriptions","organizations_url":"https://api.github.com/users/bem/orgs","repos_url":"https://api.github.com/users/bem/repos","events_url":"https://api.github.com/users/bem/events{/privacy}","received_events_url":"https://api.github.com/users/bem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bem/bem-xjst","description":"Declarative template engine for the browser and server","fork":false,"url":"https://api.github.com/repos/bem/bem-xjst","forks_url":"https://api.github.com/repos/bem/bem-xjst/forks","keys_url":"https://api.github.com/repos/bem/bem-xjst/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bem/bem-xjst/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bem/bem-xjst/teams","hooks_url":"https://api.github.com/repos/bem/bem-xjst/hooks","issue_events_url":"https://api.github.com/repos/bem/bem-xjst/issues/events{/number}","events_url":"https://api.github.com/repos/bem/bem-xjst/events","assignees_url":"https://api.github.com/repos/bem/bem-xjst/assignees{/user}","branches_url":"https://api.github.com/repos/bem/bem-xjst/branches{/branch}","tags_url":"https://api.github.com/repos/bem/bem-xjst/tags","blobs_url":"https://api.github.com/repos/bem/bem-xjst/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bem/bem-xjst/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bem/bem-xjst/git/refs{/sha}","trees_url":"https://api.github.com/repos/bem/bem-xjst/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bem/bem-xjst/statuses/{sha}","languages_url":"https://api.github.com/repos/bem/bem-xjst/languages","stargazers_url":"https://api.github.com/repos/bem/bem-xjst/stargazers","contributors_url":"https://api.github.com/repos/bem/bem-xjst/contributors","subscribers_url":"https://api.github.com/repos/bem/bem-xjst/subscribers","subscription_url":"https://api.github.com/repos/bem/bem-xjst/subscription","commits_url":"https://api.github.com/repos/bem/bem-xjst/commits{/sha}","git_commits_url":"https://api.github.com/repos/bem/bem-xjst/git/commits{/sha}","comments_url":"https://api.github.com/repos/bem/bem-xjst/comments{/number}","issue_comment_url":"https://api.github.com/repos/bem/bem-xjst/issues/comments{/number}","contents_url":"https://api.github.com/repos/bem/bem-xjst/contents/{+path}","compare_url":"https://api.github.com/repos/bem/bem-xjst/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bem/bem-xjst/merges","archive_url":"https://api.github.com/repos/bem/bem-xjst/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bem/bem-xjst/downloads","issues_url":"https://api.github.com/repos/bem/bem-xjst/issues{/number}","pulls_url":"https://api.github.com/repos/bem/bem-xjst/pulls{/number}","milestones_url":"https://api.github.com/repos/bem/bem-xjst/milestones{/number}","notifications_url":"https://api.github.com/repos/bem/bem-xjst/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bem/bem-xjst/labels{/name}","releases_url":"https://api.github.com/repos/bem/bem-xjst/releases{/id}","deployments_url":"https://api.github.com/repos/bem/bem-xjst/deployments","created_at":"2013-05-13T09:22:05Z","updated_at":"2016-09-01T15:14:43Z","pushed_at":"2016-09-05T13:08:12Z","git_url":"git://github.com/bem/bem-xjst.git","ssh_url":"git@github.com:bem/bem-xjst.git","clone_url":"https://github.com/bem/bem-xjst.git","svn_url":"https://github.com/bem/bem-xjst","homepage":"https://bem.github.io/bem-xjst","size":1513,"stargazers_count":77,"watchers_count":77,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":27,"mirror_url":null,"open_issues_count":68,"forks":27,"open_issues":68,"watchers":77,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bem/bem-xjst/pulls/342"},"html":{"href":"https://github.com/bem/bem-xjst/pull/342"},"issue":{"href":"https://api.github.com/repos/bem/bem-xjst/issues/342"},"comments":{"href":"https://api.github.com/repos/bem/bem-xjst/issues/342/comments"},"review_comments":{"href":"https://api.github.com/repos/bem/bem-xjst/pulls/342/comments"},"review_comment":{"href":"https://api.github.com/repos/bem/bem-xjst/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bem/bem-xjst/pulls/342/commits"},"statuses":{"href":"https://api.github.com/repos/bem/bem-xjst/statuses/30ee948baf7d1c48fccd0efbc0e76e3bb3e5fff3"}}}}
{"actor":{"display_login":"zxqfox"}}