Lines Matching refs:v8

34 #include "bindings/core/v8/ScriptValue.h"
35 #include "bindings/core/v8/V8Binding.h"
36 #include <v8-debug.h>
40 JavaScriptCallFrame::JavaScriptCallFrame(v8::Handle<v8::Context> debuggerContext, v8::Handle<v8::Object> callFrame)
41 : m_isolate(v8::Isolate::GetCurrent())
54 v8::HandleScope handleScope(m_isolate);
55 v8::Handle<v8::Context> debuggerContext = m_debuggerContext.newLocal(m_isolate);
56 v8::Context::Scope contextScope(debuggerContext);
57 v8::Handle<v8::Value> callerFrame = m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "caller"));
60 m_caller = JavaScriptCallFrame::create(debuggerContext, v8::Handle<v8::Object>::Cast(callerFrame));
67 v8::HandleScope handleScope(m_isolate);
68 v8::Context::Scope contextScope(m_debuggerContext.newLocal(m_isolate));
69 v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate);
70 v8::Handle<v8::Function> func = v8::Handle<v8::Function>::Cast(callFrame->Get(v8AtomicString(m_isolate, name)));
71 v8::Handle<v8::Value> result = func->Call(callFrame, 0, 0);
79 v8::HandleScope handleScope(m_isolate);
80 v8::Context::Scope contextScope(m_debuggerContext.newLocal(m_isolate));
81 v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate);
82 v8::Handle<v8::Function> func = v8::Handle<v8::Function>::Cast(callFrame->Get(v8AtomicString(m_isolate, name)));
83 v8::Handle<v8::Value> result = func->Call(callFrame, 0, 0);
112 v8::Handle<v8::Value> JavaScriptCallFrame::scopeChain() const
114 v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate);
115 v8::Handle<v8::Function> func = v8::Handle<v8::Function>::Cast(callFrame->Get(v8AtomicString(m_isolate, "scopeChain")));
116 v8::Handle<v8::Array> scopeChain = v8::Handle<v8::Array>::Cast(func->Call(callFrame, 0, 0));
117 v8::Handle<v8::Array> result = v8::Array::New(m_isolate, scopeChain->Length());
125 v8::Handle<v8::Array> scopeType = v8::Handle<v8::Array>::Cast(m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "scopeType")));
129 v8::Handle<v8::Value> JavaScriptCallFrame::thisObject() const
141 v8::HandleScope handleScope(m_isolate);
142 v8::Context::Scope contextScope(m_debuggerContext.newLocal(m_isolate));
143 v8::Handle<v8::Value> result = m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "isAtReturn"));
149 v8::Handle<v8::Value> JavaScriptCallFrame::returnValue() const
154 v8::Handle<v8::Value> JavaScriptCallFrame::evaluateWithExceptionDetails(const String& expression)
156 v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate);
157 v8::Handle<v8::Function> evalFunction = v8::Handle<v8::Function>::Cast(callFrame->Get(v8AtomicString(m_isolate, "evaluate")));
158 v8::Handle<v8::Value> argv[] = { v8String(m_debuggerContext.newLocal(m_isolate)->GetIsolate(), expression) };
159 v8::TryCatch tryCatch;
160 v8::Handle<v8::Value> result = evalFunction->Call(callFrame, WTF_ARRAY_LENGTH(argv), argv);
162 v8::Handle<v8::Object> wrappedResult = v8::Object::New(m_isolate);
164 wrappedResult->Set(v8::String::NewFromUtf8(m_isolate, "result"), tryCatch.Exception());
165 wrappedResult->Set(v8::String::NewFromUtf8(m_isolate, "exceptionDetails"), createExceptionDetails(tryCatch.Message(), m_isolate));
167 wrappedResult->Set(v8::String::NewFromUtf8(m_isolate, "result"), result);
168 wrappedResult->Set(v8::String::NewFromUtf8(m_isolate, "exceptionDetails"), v8::Undefined(m_isolate));
173 v8::Handle<v8::Value> JavaScriptCallFrame::restart()
175 v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate);
176 v8::Handle<v8::Function> restartFunction = v8::Handle<v8::Function>::Cast(callFrame->Get(v8AtomicString(m_isolate, "restart")));
177 v8::Debug::SetLiveEditEnabled(m_isolate, true);
178 v8::Handle<v8::Value> result = restartFunction->Call(callFrame, 0, 0);
179 v8::Debug::SetLiveEditEnabled(m_isolate, false);
186 v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate);
187 v8::Handle<v8::Function> setVariableValueFunction = v8::Handle<v8::Function>::Cast(callFrame->Get(v8AtomicString(m_isolate, "setVariableValue")));
188 v8::Handle<v8::Value> argv[] = {
189 v8::Handle<v8::Value>(v8::Integer::New(m_isolate, scopeNumber)),
196 v8::Handle<v8::Object> JavaScriptCallFrame::createExceptionDetails(v8::Handle<v8::Message> message, v8::Isolate* isolate)
198 v8::Handle<v8::Object> exceptionDetails = v8::Object::New(isolate);
199 exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "text"), message->Get());
200 exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "url"), message->GetScriptOrigin().ResourceName());
201 exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "line"), v8::Integer::New(isolate, message->GetLineNumber()));
202 exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "column"), v8::Integer::New(isolate, message->GetStartColumn()));
204 exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "stackTrace"), message->GetStackTrace()->AsArray());
206 exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "stackTrace"), v8::Undefined(isolate));