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}
355
356Valdi::StringBox QuickJSJavaScriptContext::propertyNameToString(const Valdi::JSPropertyName& propertyName) {
357 auto guard = _threadAccessChecker.guard();
358 const auto* cString = JS_AtomToCString(_context, fromValdiJSPropertyName(propertyName));
359 if (cString == nullptr) {
360 return Valdi::StringBox();
361 }
362
363 auto convertedString = Valdi::StringCache::makeStringFromCLiteral(cString);
364
365 JS_FreeCString(_context, cString);
366
367 return convertedString;
368}
369
370Valdi::JSValueRef QuickJSJavaScriptContext::newObject(Valdi::JSExceptionTracker& exceptionTracker) {
371 auto guard = _threadAccessChecker.guard();

Callers

nothing calls this directly

Calls 3

guardMethod · 0.80
fromValdiJSPropertyNameFunction · 0.70
StringBoxClass · 0.50

Tested by

no test coverage detected