We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05f2390 commit 9aa4e66Copy full SHA for 9aa4e66
index.js
@@ -4,10 +4,11 @@ module.exports = function (src, file) {
4
if (typeof src !== 'string') src = String(src);
5
6
try {
7
- Function(src);
+ eval('throw "STOP"; (function () { ' + src + '})()');
8
return;
9
}
10
catch (err) {
11
+ if (err === 'STOP') return undefined;
12
if (err.constructor.name !== 'SyntaxError') throw err;
13
return errorInfo(src, file);
14
test/sources/run2.js
@@ -1 +1,3 @@
1
-}); process.exit(1); (function () {
+})();
2
+process.exit(1);
3
+(function () {
0 commit comments