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 tsn_module_info moduleInfo;
355 if (!tsn_get_module_info(sourceFilename.data(), &moduleInfo)) {
356 return std::nullopt;
357 }
358
359 Valdi::IJavaScriptNativeModuleInfo outputInfo;
360 outputInfo.sha256 = Valdi::StringCache::getGlobal().makeString(std::string_view(moduleInfo.sha256));
361 outputInfo.name = Valdi::StringCache::getGlobal().makeString(std::string_view(moduleInfo.name));
362
363 return outputInfo;
364}
365
366Valdi::JSPropertyNameRef QuickJSJavaScriptContext::newPropertyName(const std::string_view& str) {
367 auto guard = _threadAccessChecker.guard();
368 JSAtom atom = JS_NewAtomLen(_context, str.data(), str.size());
369 return Valdi::JSPropertyNameRef(this, toValdiJSPropertyName(atom), true);
370}
371

Callers

nothing calls this directly

Calls 3

guardMethod · 0.80
fromValdiJSPropertyNameFunction · 0.70
StringBoxClass · 0.50

Tested by

no test coverage detected