{"action":"opened","issue":{"url":"https://api.github.com/repos/npm/npm/issues/10486","labels_url":"https://api.github.com/repos/npm/npm/issues/10486/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/10486/comments","events_url":"https://api.github.com/repos/npm/npm/issues/10486/events","html_url":"https://github.com/npm/npm/issues/10486","id":117929966,"number":10486,"title":"Several .js files have illegal return and throw statements at the top level","user":{"login":"yurivict","id":271906,"avatar_url":"https://avatars.githubusercontent.com/u/271906?v=3","gravatar_id":"","url":"https://api.github.com/users/yurivict","html_url":"https://github.com/yurivict","followers_url":"https://api.github.com/users/yurivict/followers","following_url":"https://api.github.com/users/yurivict/following{/other_user}","gists_url":"https://api.github.com/users/yurivict/gists{/gist_id}","starred_url":"https://api.github.com/users/yurivict/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurivict/subscriptions","organizations_url":"https://api.github.com/users/yurivict/orgs","repos_url":"https://api.github.com/users/yurivict/repos","events_url":"https://api.github.com/users/yurivict/events{/privacy}","received_events_url":"https://api.github.com/users/yurivict/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-19T23:10:07Z","updated_at":"2015-11-19T23:10:07Z","closed_at":null,"body":"Here is the complete list of files, esprima complains about them:\r\n```\r\nnode_modules/fstream-npm/node_modules/fstream-ignore/test/common.js\r\nnode_modules/init-package-json/node_modules/promzard/test/exports.js\r\nnode_modules/init-package-json/node_modules/promzard/test/fn.js\r\nnode_modules/lockfile/test/stale-contention.js\r\nnode_modules/mkdirp/bin/cmd.js\r\nnode_modules/node-gyp/bin/node-gyp.js\r\nnode_modules/osenv/test/unix.js\r\nnode_modules/osenv/test/windows.js\r\nnode_modules/request/node_modules/bl/test/test.js\r\nnode_modules/slide/lib/async-map-ordered.js\r\n```\r\n\r\nHere is the program that parses .js:\r\n```\r\n#!/usr/bin/env node\r\n\r\nesprima = require('esprima')\r\nconst stripShebang = require('strip-shebang');\r\nfs = require(\"fs\");\r\n\r\nfunction parseFile(fname) {\r\n  var str = fs.readFileSync(fname, \"utf8\")\r\n  str = stripShebang(str)\r\n  esprima.parse(str)\r\n}\r\n\r\nparseFile(process.argv[2])\r\n```"}}