{"action":"created","comment":{"url":"https://api.github.com/repos/jquery/esprima/pulls/comments/34947555","id":34947555,"diff_hunk":"@@ -0,0 +1,70 @@\n+/*\n+  Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved.\n+  Redistribution and use in source and binary forms, with or without\n+  modification, are permitted provided that the following conditions are met:\n+    * Redistributions of source code must retain the above copyright\n+      notice, this list of conditions and the following disclaimer.\n+    * Redistributions in binary form must reproduce the above copyright\n+      notice, this list of conditions and the following disclaimer in the\n+      documentation and/or other materials provided with the distribution.\n+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n+  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n+  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n+  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n+  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+*/\n+\n+/*\n+    Reads the fixture files in `test/fixtures` and writes\n+    two aggregate fixture files (`test/dist/fixtures_js.js` and `test/dist/fixtures_json.js`)\n+*/\n+\n+'use strict';\n+\n+var fs = require('fs'),\n+    glob = require(\"glob\"),\n+    path = require('path'),\n+    _ = require('lodash'),\n+    fixturePath = 'test/fixtures',\n+    fixtureDist = 'test/dist';\n+\n+function renderFixturesFile(ext, stringify) {\n+    var fixtureFilePaths, fixtures, content, fixtureDistPath;\n+\n+    function renderFixture(filePath) {\n+        var content, relativeFilePath, key, value;\n+\n+        content = fs.readFileSync(filePath, 'utf-8');\n+        relativeFilePath = path.relative(fixturePath, filePath);\n+        key = relativeFilePath.substring(0, relativeFilePath.length - ext.length - 1);\n+        value = stringify ? JSON.stringify(content) : content;\n+\n+        return \"fixtures_\" + ext + \"['\" + key + \"'] = \" + value + \";\";\n+    };\n+\n+    function templateFixtureFile(fixtures) {\n+        var content = \"\";\n+        content += \"var fixtures_\" + ext + \" = {};\\n\";\n+        content += fixtures;\n+        content += \"module.exports = fixtures_\" + ext;\n+\n+        return content;\n+    }\n+\n+    fixtureFilePaths = glob.sync(path.join(__dirname, '../test/fixtures/**/*.' + ext));\n+    fixtures = _.map(fixtureFilePaths, renderFixture).join('\\n');","path":"tools/generate-fixtures.js","position":60,"original_position":60,"commit_id":"5ca08260d4ae9e19ac415d5bcd38f5c75fb683a9","original_commit_id":"5ca08260d4ae9e19ac415d5bcd38f5c75fb683a9","user":{"login":"ariya","id":7288,"avatar_url":"https://avatars.githubusercontent.com/u/7288?v=3","gravatar_id":"","url":"https://api.github.com/users/ariya","html_url":"https://github.com/ariya","followers_url":"https://api.github.com/users/ariya/followers","following_url":"https://api.github.com/users/ariya/following{/other_user}","gists_url":"https://api.github.com/users/ariya/gists{/gist_id}","starred_url":"https://api.github.com/users/ariya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ariya/subscriptions","organizations_url":"https://api.github.com/users/ariya/orgs","repos_url":"https://api.github.com/users/ariya/repos","events_url":"https://api.github.com/users/ariya/events{/privacy}","received_events_url":"https://api.github.com/users/ariya/received_events","type":"User","site_admin":false},"body":"I have no objection on the use of lodash/underscore, but if this is where it is used for now, perhaps we should stick the built-in Array#map?","created_at":"2015-07-18T13:10:41Z","updated_at":"2015-07-18T13:10:41Z","html_url":"https://github.com/jquery/esprima/pull/1240#discussion_r34947555","pull_request_url":"https://api.github.com/repos/jquery/esprima/pulls/1240","_links":{"self":{"href":"https://api.github.com/repos/jquery/esprima/pulls/comments/34947555"},"html":{"href":"https://github.com/jquery/esprima/pull/1240#discussion_r34947555"},"pull_request":{"href":"https://api.github.com/repos/jquery/esprima/pulls/1240"}}},"pull_request":{"url":"https://api.github.com/repos/jquery/esprima/pulls/1240","id":40253452,"html_url":"https://github.com/jquery/esprima/pull/1240","diff_url":"https://github.com/jquery/esprima/pull/1240.diff","patch_url":"https://github.com/jquery/esprima/pull/1240.patch","issue_url":"https://api.github.com/repos/jquery/esprima/issues/1240","number":1240,"state":"open","locked":false,"title":"Add tools/generate-fixtures.js","user":{"login":"jasonLaster","id":254562,"avatar_url":"https://avatars.githubusercontent.com/u/254562?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonLaster","html_url":"https://github.com/jasonLaster","followers_url":"https://api.github.com/users/jasonLaster/followers","following_url":"https://api.github.com/users/jasonLaster/following{/other_user}","gists_url":"https://api.github.com/users/jasonLaster/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonLaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonLaster/subscriptions","organizations_url":"https://api.github.com/users/jasonLaster/orgs","repos_url":"https://api.github.com/users/jasonLaster/repos","events_url":"https://api.github.com/users/jasonLaster/events{/privacy}","received_events_url":"https://api.github.com/users/jasonLaster/received_events","type":"User","site_admin":false},"body":"The tool reads the js and json fixtures and builds two fixture files.\r\n\r\nI added two npm packages as devDependencies `lodash` and `glob`. They're\r\nboth pretty minor and I don't feel strongly about either.\r\n\r\nHere are the two resulting gists:\r\nhttps://gist.github.com/50f41ee3d919b4d76759\r\nhttps://gist.github.com/7c16f3f107ab805f0993","created_at":"2015-07-17T17:32:15Z","updated_at":"2015-07-18T13:10:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7192292004be882ce19ad4068d3582c3c06fac9d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jquery/esprima/pulls/1240/commits","review_comments_url":"https://api.github.com/repos/jquery/esprima/pulls/1240/comments","review_comment_url":"https://api.github.com/repos/jquery/esprima/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jquery/esprima/issues/1240/comments","statuses_url":"https://api.github.com/repos/jquery/esprima/statuses/5ca08260d4ae9e19ac415d5bcd38f5c75fb683a9","head":{"label":"jasonLaster:fixtures","ref":"fixtures","sha":"5ca08260d4ae9e19ac415d5bcd38f5c75fb683a9","user":{"login":"jasonLaster","id":254562,"avatar_url":"https://avatars.githubusercontent.com/u/254562?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonLaster","html_url":"https://github.com/jasonLaster","followers_url":"https://api.github.com/users/jasonLaster/followers","following_url":"https://api.github.com/users/jasonLaster/following{/other_user}","gists_url":"https://api.github.com/users/jasonLaster/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonLaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonLaster/subscriptions","organizations_url":"https://api.github.com/users/jasonLaster/orgs","repos_url":"https://api.github.com/users/jasonLaster/repos","events_url":"https://api.github.com/users/jasonLaster/events{/privacy}","received_events_url":"https://api.github.com/users/jasonLaster/received_events","type":"User","site_admin":false},"repo":{"id":38940317,"name":"esprima","full_name":"jasonLaster/esprima","owner":{"login":"jasonLaster","id":254562,"avatar_url":"https://avatars.githubusercontent.com/u/254562?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonLaster","html_url":"https://github.com/jasonLaster","followers_url":"https://api.github.com/users/jasonLaster/followers","following_url":"https://api.github.com/users/jasonLaster/following{/other_user}","gists_url":"https://api.github.com/users/jasonLaster/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonLaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonLaster/subscriptions","organizations_url":"https://api.github.com/users/jasonLaster/orgs","repos_url":"https://api.github.com/users/jasonLaster/repos","events_url":"https://api.github.com/users/jasonLaster/events{/privacy}","received_events_url":"https://api.github.com/users/jasonLaster/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jasonLaster/esprima","description":"ECMAScript parsing infrastructure for multipurpose analysis","fork":true,"url":"https://api.github.com/repos/jasonLaster/esprima","forks_url":"https://api.github.com/repos/jasonLaster/esprima/forks","keys_url":"https://api.github.com/repos/jasonLaster/esprima/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jasonLaster/esprima/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jasonLaster/esprima/teams","hooks_url":"https://api.github.com/repos/jasonLaster/esprima/hooks","issue_events_url":"https://api.github.com/repos/jasonLaster/esprima/issues/events{/number}","events_url":"https://api.github.com/repos/jasonLaster/esprima/events","assignees_url":"https://api.github.com/repos/jasonLaster/esprima/assignees{/user}","branches_url":"https://api.github.com/repos/jasonLaster/esprima/branches{/branch}","tags_url":"https://api.github.com/repos/jasonLaster/esprima/tags","blobs_url":"https://api.github.com/repos/jasonLaster/esprima/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jasonLaster/esprima/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jasonLaster/esprima/git/refs{/sha}","trees_url":"https://api.github.com/repos/jasonLaster/esprima/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jasonLaster/esprima/statuses/{sha}","languages_url":"https://api.github.com/repos/jasonLaster/esprima/languages","stargazers_url":"https://api.github.com/repos/jasonLaster/esprima/stargazers","contributors_url":"https://api.github.com/repos/jasonLaster/esprima/contributors","subscribers_url":"https://api.github.com/repos/jasonLaster/esprima/subscribers","subscription_url":"https://api.github.com/repos/jasonLaster/esprima/subscription","commits_url":"https://api.github.com/repos/jasonLaster/esprima/commits{/sha}","git_commits_url":"https://api.github.com/repos/jasonLaster/esprima/git/commits{/sha}","comments_url":"https://api.github.com/repos/jasonLaster/esprima/comments{/number}","issue_comment_url":"https://api.github.com/repos/jasonLaster/esprima/issues/comments{/number}","contents_url":"https://api.github.com/repos/jasonLaster/esprima/contents/{+path}","compare_url":"https://api.github.com/repos/jasonLaster/esprima/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jasonLaster/esprima/merges","archive_url":"https://api.github.com/repos/jasonLaster/esprima/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jasonLaster/esprima/downloads","issues_url":"https://api.github.com/repos/jasonLaster/esprima/issues{/number}","pulls_url":"https://api.github.com/repos/jasonLaster/esprima/pulls{/number}","milestones_url":"https://api.github.com/repos/jasonLaster/esprima/milestones{/number}","notifications_url":"https://api.github.com/repos/jasonLaster/esprima/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jasonLaster/esprima/labels{/name}","releases_url":"https://api.github.com/repos/jasonLaster/esprima/releases{/id}","created_at":"2015-07-11T21:01:50Z","updated_at":"2015-07-11T21:01:51Z","pushed_at":"2015-07-17T17:32:02Z","git_url":"git://github.com/jasonLaster/esprima.git","ssh_url":"git@github.com:jasonLaster/esprima.git","clone_url":"https://github.com/jasonLaster/esprima.git","svn_url":"https://github.com/jasonLaster/esprima","homepage":"http://esprima.org","size":45619,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jquery:master","ref":"master","sha":"ab7846dea0b85c8fae644417957e31fc86241fcc","user":{"login":"jquery","id":70142,"avatar_url":"https://avatars.githubusercontent.com/u/70142?v=3","gravatar_id":"","url":"https://api.github.com/users/jquery","html_url":"https://github.com/jquery","followers_url":"https://api.github.com/users/jquery/followers","following_url":"https://api.github.com/users/jquery/following{/other_user}","gists_url":"https://api.github.com/users/jquery/gists{/gist_id}","starred_url":"https://api.github.com/users/jquery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jquery/subscriptions","organizations_url":"https://api.github.com/users/jquery/orgs","repos_url":"https://api.github.com/users/jquery/repos","events_url":"https://api.github.com/users/jquery/events{/privacy}","received_events_url":"https://api.github.com/users/jquery/received_events","type":"Organization","site_admin":false},"repo":{"id":2833537,"name":"esprima","full_name":"jquery/esprima","owner":{"login":"jquery","id":70142,"avatar_url":"https://avatars.githubusercontent.com/u/70142?v=3","gravatar_id":"","url":"https://api.github.com/users/jquery","html_url":"https://github.com/jquery","followers_url":"https://api.github.com/users/jquery/followers","following_url":"https://api.github.com/users/jquery/following{/other_user}","gists_url":"https://api.github.com/users/jquery/gists{/gist_id}","starred_url":"https://api.github.com/users/jquery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jquery/subscriptions","organizations_url":"https://api.github.com/users/jquery/orgs","repos_url":"https://api.github.com/users/jquery/repos","events_url":"https://api.github.com/users/jquery/events{/privacy}","received_events_url":"https://api.github.com/users/jquery/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jquery/esprima","description":"ECMAScript parsing infrastructure for multipurpose analysis","fork":false,"url":"https://api.github.com/repos/jquery/esprima","forks_url":"https://api.github.com/repos/jquery/esprima/forks","keys_url":"https://api.github.com/repos/jquery/esprima/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jquery/esprima/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jquery/esprima/teams","hooks_url":"https://api.github.com/repos/jquery/esprima/hooks","issue_events_url":"https://api.github.com/repos/jquery/esprima/issues/events{/number}","events_url":"https://api.github.com/repos/jquery/esprima/events","assignees_url":"https://api.github.com/repos/jquery/esprima/assignees{/user}","branches_url":"https://api.github.com/repos/jquery/esprima/branches{/branch}","tags_url":"https://api.github.com/repos/jquery/esprima/tags","blobs_url":"https://api.github.com/repos/jquery/esprima/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jquery/esprima/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jquery/esprima/git/refs{/sha}","trees_url":"https://api.github.com/repos/jquery/esprima/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jquery/esprima/statuses/{sha}","languages_url":"https://api.github.com/repos/jquery/esprima/languages","stargazers_url":"https://api.github.com/repos/jquery/esprima/stargazers","contributors_url":"https://api.github.com/repos/jquery/esprima/contributors","subscribers_url":"https://api.github.com/repos/jquery/esprima/subscribers","subscription_url":"https://api.github.com/repos/jquery/esprima/subscription","commits_url":"https://api.github.com/repos/jquery/esprima/commits{/sha}","git_commits_url":"https://api.github.com/repos/jquery/esprima/git/commits{/sha}","comments_url":"https://api.github.com/repos/jquery/esprima/comments{/number}","issue_comment_url":"https://api.github.com/repos/jquery/esprima/issues/comments{/number}","contents_url":"https://api.github.com/repos/jquery/esprima/contents/{+path}","compare_url":"https://api.github.com/repos/jquery/esprima/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jquery/esprima/merges","archive_url":"https://api.github.com/repos/jquery/esprima/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jquery/esprima/downloads","issues_url":"https://api.github.com/repos/jquery/esprima/issues{/number}","pulls_url":"https://api.github.com/repos/jquery/esprima/pulls{/number}","milestones_url":"https://api.github.com/repos/jquery/esprima/milestones{/number}","notifications_url":"https://api.github.com/repos/jquery/esprima/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jquery/esprima/labels{/name}","releases_url":"https://api.github.com/repos/jquery/esprima/releases{/id}","created_at":"2011-11-23T05:36:43Z","updated_at":"2015-07-17T23:16:45Z","pushed_at":"2015-07-17T17:32:15Z","git_url":"git://github.com/jquery/esprima.git","ssh_url":"git@github.com:jquery/esprima.git","clone_url":"https://github.com/jquery/esprima.git","svn_url":"https://github.com/jquery/esprima","homepage":"http://esprima.org","size":49862,"stargazers_count":2519,"watchers_count":2519,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":421,"mirror_url":null,"open_issues_count":44,"forks":421,"open_issues":44,"watchers":2519,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jquery/esprima/pulls/1240"},"html":{"href":"https://github.com/jquery/esprima/pull/1240"},"issue":{"href":"https://api.github.com/repos/jquery/esprima/issues/1240"},"comments":{"href":"https://api.github.com/repos/jquery/esprima/issues/1240/comments"},"review_comments":{"href":"https://api.github.com/repos/jquery/esprima/pulls/1240/comments"},"review_comment":{"href":"https://api.github.com/repos/jquery/esprima/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jquery/esprima/pulls/1240/commits"},"statuses":{"href":"https://api.github.com/repos/jquery/esprima/statuses/5ca08260d4ae9e19ac415d5bcd38f5c75fb683a9"}}}}