| 266 | return JSPropertyNameRef(this, toValdiJSPropertyName(IndirectV8Persistent::make(_isolate, val)), true); |
| 267 | } |
| 268 | |
| 269 | StringBox 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 | |
| 286 | JSValueRef V8JavaScriptContext::newObject(JSExceptionTracker& exceptionTracker) { |
no test coverage detected