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

Method newStringUTF16

valdi/src/valdi/jscore/JavaScriptCoreContext.cpp:390–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388
389 JSObjectSetPrototype(context, object, _functionPrototype);
390 return returnJSValueRef(object, kJSTypeObject);
391}
392
393Valdi::JSValueRef JavaScriptCoreContext::onNewBool(bool boolean) {
394 return returnJSValueRef(JSValueMakeBoolean(getJSGlobalContext(), boolean), kJSTypeBoolean);
395}
396
397Valdi::JSValueRef JavaScriptCoreContext::onNewNumber(int32_t number) {
398 return onNewNumber(static_cast<double>(number));
399}
400
401Valdi::JSValueRef JavaScriptCoreContext::onNewNumber(double number) {
402 auto context = getJSGlobalContext();
403 return returnJSValueRef(JSValueMakeNumber(context, number), kJSTypeNumber);
404}
405
406Valdi::JSValueRef JavaScriptCoreContext::newStringUTF8(const std::string_view& str,
407 Valdi::JSExceptionTracker& exceptionTracker) {

Callers

nothing calls this directly

Calls 6

utf16ToUtf8Function · 0.85
toValdiJSPropertyNameFunction · 0.70
fromValdiJSPropertyNameFunction · 0.70
getMethod · 0.65
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected