MCPcopy Create free account
hub / github.com/Snapchat/Valdi / decodeSkipList

Function decodeSkipList

tsn/src/test262/runner/main.cpp:30–59  ·  view source on GitHub ↗

NOTE(rjaber): There are some bug in current compilation, and this is temp measure to avoid hitting assert / heap corruption / segfaults in the typescript VM

Source from the content-addressed store, hash-verified

28// NOTE(rjaber): There are some bug in current compilation, and this is temp measure to avoid hitting assert / heap
29// corruption / segfaults in the typescript VM
30static set<std::string> decodeSkipList(const fs::path& skipListFile) {
31 auto skipListResult = DiskUtils::load(Path(skipListFile.string()));
32 if (!skipListResult) {
33 TEST262_LOG(cerr, "Failed to save file {} with error {}", skipListFile, skipListResult.error().getMessage());
34 return {};
35 }
36 const auto skipListData = skipListResult.moveValue();
37 auto skipListValueResult = jsonToValue(skipListData.data(), skipListData.size());
38 if (!skipListValueResult) {
39 TEST262_LOG(
40 cerr, "Failed to parse file {} with error {}", skipListFile, skipListValueResult.error().getMessage());
41 return {};
42 }
43 const auto skipListValue = skipListValueResult.moveValue();
44 if (!skipListValue.isArray()) {
45 TEST262_LOG(cerr, "Parsed file {} expected top level array", skipListFile);
46 return {};
47 }
48
49 set<string> retval;
50 for (const auto& skip : *skipListValue.getArrayRef()) {
51 if (!skip.isString()) {
52 TEST262_LOG(cerr, "skip list element for {} is not a string", skipListFile);
53 }
54
55 retval.insert(skip.toString());
56 }
57
58 return retval;
59}
60
61static void decodeException(JSContext* ctx, std::string& errorType, std::string& errorDescription) {
62 JSValue exception_val;

Callers 1

runTestCasesFunction · 0.85

Calls 13

loadFunction · 0.85
getArrayRefMethod · 0.80
getMessageMethod · 0.65
errorMethod · 0.65
insertMethod · 0.65
toStringMethod · 0.65
PathClass · 0.50
jsonToValueFunction · 0.50
stringMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
isArrayMethod · 0.45

Tested by

no test coverage detected