improve unsafe comparisons (#3200)

This commit is contained in:
Alex Lam S.L
2018-06-28 03:46:19 +08:00
committed by GitHub
parent 88c8f4e363
commit 957d5537a8
4 changed files with 128 additions and 45 deletions

View File

@@ -79,7 +79,7 @@ exports.run_code = function(code, reuse) {
return ex;
} finally {
process.stdout.write = original_write;
if (!reuse || /prototype/.test(code)) {
if (!reuse || code.indexOf(".prototype") >= 0) {
context = null;
} else for (var key in context) {
delete context[key];