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

Method propertyNameToString

valdi/src/valdi/quickjs/QuickJSJavaScriptContext.cpp:356–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

354 auto guard = _threadAccessChecker.guard();
355 return checkCallAndGetValue(exceptionTracker, tsn_load_module(_context, sourceFilename.data()));
356}
357
358std::optional<Valdi::IJavaScriptNativeModuleInfo> QuickJSJavaScriptContext::getNativeModuleInfo(
359 const std::string_view& sourceFilename) {
360 tsn_module_info moduleInfo;
361 if (!tsn_get_module_info(sourceFilename.data(), &moduleInfo)) {
362 return std::nullopt;
363 }
364
365 Valdi::IJavaScriptNativeModuleInfo outputInfo;
366 outputInfo.sha256 = Valdi::StringCache::getGlobal().makeString(std::string_view(moduleInfo.sha256));
367 outputInfo.name = Valdi::StringCache::getGlobal().makeString(std::string_view(moduleInfo.name));
368
369 return outputInfo;
370}
371

Callers

nothing calls this directly

Calls 3

guardMethod · 0.80
fromValdiJSPropertyNameFunction · 0.70
StringBoxClass · 0.50

Tested by

no test coverage detected