diff --git a/src/shell/Shell.cpp b/src/shell/Shell.cpp
index 3d76a4e54..2d06a6f68 100644
--- a/src/shell/Shell.cpp
+++ b/src/shell/Shell.cpp
@@ -1066,6 +1066,7 @@ int main(int argc, char* argv[])
bool runShell = true;
bool seenModule = false;
std::string fileName;
+ int exitCode = 0;
for (int i = 1; i < argc; i++) {
if (strlen(argv[i]) >= 2 && argv[i][0] == '-') { // parse command line option
@@ -1097,8 +1098,11 @@ int main(int argc, char* argv[])
if (!clientSourceRef) {
break;
}
- if (!evalScript(context, clientSourceRef, sourceName, false, false))
- return 3;
+ if (!evalScript(context, clientSourceRef, sourceName, false, false)) {
+ runShell = false;
+ exitCode = 3;
+ break;
+ }
runShell = false;
}
continue;
@@ -1112,8 +1116,11 @@ int main(int argc, char* argv[])
runShell = false;
i++;
StringRef* src = StringRef::createFromUTF8(argv[i], strlen(argv[i]));
- if (!evalScript(context, src, StringRef::createFromASCII("shell input"), false, false))
- return 3;
+ if (!evalScript(context, src, StringRef::createFromASCII("shell input"), false, false)) {
+ runShell = false;
+ exitCode = 3;
+ break;
+ }
continue;
}
if (strcmp(argv[i], "-f") == 0) {
@@ -1121,7 +1128,6 @@ int main(int argc, char* argv[])
}
}
fprintf(stderr, "Cannot recognize option `%s`", argv[i]);
- // return 3;
continue;
}
@@ -1141,7 +1147,9 @@ int main(int argc, char* argv[])
}
if (!evalScript(context, src, StringRef::createFromUTF8(fileName.data(), fileName.length()), false, seenModule)) {
- return 3;
+ runShell = false;
+ exitCode = 3;
+ break;
}
seenModule = false;
fileName.clear();
@@ -1168,7 +1176,8 @@ int main(int argc, char* argv[])
printf("escargot> ");
if (!fgets(buf, sizeof buf, stdin)) {
printf("ERROR: Cannot read interactive shell input\n");
- return 3;
+ exitCode = 3;
+ break;
}
StringRef* str = Escargot::StringRef::createFromUTF8(buf, strlen(buf));
evalScript(context, str, StringRef::emptyString(), true, false);
@@ -1207,5 +1216,5 @@ int main(int argc, char* argv[])
ProfilerStop();
#endif
- return 0;
+ return exitCode;
}
diff --git a/tools/test/test262/excludelist.orig.xml b/tools/test/test262/excludelist.orig.xml
index ccf9f13df..af8e2c23a 100644
--- a/tools/test/test262/excludelist.orig.xml
+++ b/tools/test/test262/excludelist.orig.xml
@@ -178,8 +178,6 @@
TODO
TODO
TODO
- TODO
- TODO
TODO
TODO
TODO
diff --git a/tools/test/test262/test262.py b/tools/test/test262/test262.py
index 519e393f5..715f1617c 100755
--- a/tools/test/test262/test262.py
+++ b/tools/test/test262/test262.py
@@ -325,7 +325,8 @@ def GetDriverSource(self):
self.suite.GetInclude("cth.js") + \
self.suite.GetInclude("assert.js")
- if self.IsAsyncTest():
+ # Escargot: some async test are does not returns True for self.IsAsyncTest()
+ if self.IsAsyncTest() or "Atomics" in self.GetFeatureList():
source = source + \
self.suite.GetInclude("timer.js") + \
self.suite.GetInclude("doneprintHandle.js").replace('print', self.suite.print_handle)