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

Method propertyNameToString

valdi/src/valdi/v8/V8JavaScriptContext.cpp:268–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266 return JSPropertyNameRef(this, toValdiJSPropertyName(IndirectV8Persistent::make(_isolate, val)), true);
267}
268
269StringBox V8JavaScriptContext::propertyNameToString(const JSPropertyName& propertyName) {
270 v8::HandleScope handleScope(_isolate);
271 JSExceptionTracker tracker(*this);
272 auto propertyValue = fromValdiJSPropertyName(_isolate, propertyName, tracker);
273 if (!tracker) {
274 // TODO(rjaber): Figure out the error handling here
275 return StringBox();
276 }
277 v8::String::Utf8Value propertyValueString(_isolate, propertyValue);
278
279 auto stringData = *propertyValueString;
280 auto stringLength = propertyValueString.length();
281
282 // TODO(rjaber): Find a way to avoid the copy, or move it to creation ?
283 return StringCache::getGlobal().makeString(stringData, stringLength);
284}
285
286JSValueRef V8JavaScriptContext::newObject(JSExceptionTracker& exceptionTracker) {

Callers 4

visitPropertyNameMethod · 0.45
visitPropertyNameMethod · 0.45
visitPropertyNameMethod · 0.45
mainFunction · 0.45

Calls 5

getGlobalFunction · 0.85
makeStringMethod · 0.80
fromValdiJSPropertyNameFunction · 0.70
StringBoxClass · 0.50
lengthMethod · 0.45

Tested by

no test coverage detected