String V8Proxy::sourceName() { v8::HandleScope scope; v8::Handle<v8::Context> v8UtilityContext = utilityContext(); if (v8UtilityContext.IsEmpty()) return String(); v8::Context::Scope contextScope(v8UtilityContext); v8::Handle<v8::Function> frameSourceName; frameSourceName = v8::Local<v8::Function>::Cast(v8UtilityContext->Global()->Get(v8::String::New("frameSourceName"))); if (frameSourceName.IsEmpty()) return String(); return toWebCoreString(v8::Debug::Call(frameSourceName)); }
bool V8Proxy::sourceName(String& result) { v8::HandleScope scope; v8::Handle<v8::Context> v8UtilityContext = utilityContext(); if (v8UtilityContext.IsEmpty()) return false; v8::Context::Scope contextScope(v8UtilityContext); v8::Handle<v8::Function> frameSourceName; frameSourceName = v8::Local<v8::Function>::Cast(v8UtilityContext->Global()->Get(v8::String::New("frameSourceName"))); if (frameSourceName.IsEmpty()) return false; v8::Handle<v8::Value> value = v8::Debug::Call(frameSourceName); if (value.IsEmpty()) return false; result = toWebCoreString(value); return true; }