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

Method newPropertyName

valdi/src/valdi/v8/V8JavaScriptContext.cpp:255–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253}
254
255JSPropertyNameRef V8JavaScriptContext::newPropertyName(const std::string_view& str) {
256 v8::HandleScope handleScope(_isolate);
257
258 auto maybeValue =
259 v8::String::NewFromUtf8(_isolate, str.data(), v8::NewStringType::kNormal, static_cast<int32_t>(str.length()));
260 v8::Local<v8::String> val;
261 if (!maybeValue.ToLocal(&val)) {
262 return JSPropertyNameRef();
263 }
264
265 return JSPropertyNameRef(this, toValdiJSPropertyName(IndirectV8Persistent::make(_isolate, val)), true);
266}
267
268StringBox V8JavaScriptContext::propertyNameToString(const JSPropertyName& propertyName) {
269 v8::HandleScope handleScope(_isolate);

Callers 6

loadPropertyNamesFunction · 0.45
runtimeGetAssetsMethod · 0.45
JavaScriptObjectStoreMethod · 0.45
newObjectClassMethod · 0.45
mainFunction · 0.45

Calls 4

ToLocalMethod · 0.80
toValdiJSPropertyNameFunction · 0.70
dataMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected