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

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