| 338 | } |
| 339 | |
| 340 | StringBox HermesJavaScriptContext::propertyNameToString(const JSPropertyName& propertyName) { |
| 341 | hermes::vm::GCScope gcScope(*_runtime); |
| 342 | |
| 343 | auto symbolId = toSymbolID(propertyName); |
| 344 | auto str = _runtime->getStringPrimFromSymbolID(symbolId.get()); |
| 345 | |
| 346 | auto stringView = hermes::vm::StringPrimitive::createStringView(*_runtime, _runtime->makeHandle(str)); |
| 347 | |
| 348 | if (stringView.isASCII()) { |
| 349 | return StringCache::getGlobal().makeString(stringView.castToCharPtr(), stringView.length()); |
| 350 | } else { |
| 351 | return StringCache::getGlobal().makeStringFromUTF16(stringView.castToChar16Ptr(), stringView.length()); |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | JSValueRef HermesJavaScriptContext::newObject(JSExceptionTracker& exceptionTracker) { |
| 356 | hermes::vm::GCScope gcScope(*_runtime); |
nothing calls this directly
no test coverage detected