OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 v8::Local<v8::Object> callFrame = v8::Local<v8::Object>::New(m_isolate, m_ca
llFrame); | 216 v8::Local<v8::Object> callFrame = v8::Local<v8::Object>::New(m_isolate, m_ca
llFrame); |
217 v8::Local<v8::Function> setVariableValueFunction = v8::Local<v8::Function>::
Cast(callFrame->Get(toV8StringInternalized(m_isolate, "setVariableValue"))); | 217 v8::Local<v8::Function> setVariableValueFunction = v8::Local<v8::Function>::
Cast(callFrame->Get(toV8StringInternalized(m_isolate, "setVariableValue"))); |
218 v8::Local<v8::Value> argv[] = { | 218 v8::Local<v8::Value> argv[] = { |
219 v8::Local<v8::Value>(v8::Integer::New(m_isolate, scopeNumber)), | 219 v8::Local<v8::Value>(v8::Integer::New(m_isolate, scopeNumber)), |
220 variableName, | 220 variableName, |
221 newValue | 221 newValue |
222 }; | 222 }; |
223 return setVariableValueFunction->Call(m_isolate->GetCurrentContext(), callFr
ame, WTF_ARRAY_LENGTH(argv), argv); | 223 return setVariableValueFunction->Call(m_isolate->GetCurrentContext(), callFr
ame, WTF_ARRAY_LENGTH(argv), argv); |
224 } | 224 } |
225 | 225 |
226 v8::Local<v8::Object> JavaScriptCallFrame::createExceptionDetails(v8::Isolate* i
solate, v8::Local<v8::Message> message) | |
227 { | |
228 v8::Local<v8::Object> exceptionDetails = v8::Object::New(isolate); | |
229 exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "text"), message->Get
()); | |
230 exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "url"), message->GetS
criptOrigin().ResourceName()); | |
231 exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "scriptId"), v8::Inte
ger::New(isolate, message->GetScriptOrigin().ScriptID()->Value())); | |
232 exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "line"), v8::Integer:
:New(isolate, message->GetLineNumber())); | |
233 exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "column"), v8::Intege
r::New(isolate, message->GetStartColumn())); | |
234 if (!message->GetStackTrace().IsEmpty()) | |
235 exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "stackTrace"), me
ssage->GetStackTrace()->AsArray()); | |
236 else | |
237 exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "stackTrace"), v8
::Undefined(isolate)); | |
238 return exceptionDetails; | |
239 } | |
240 | |
241 } // namespace blink | 226 } // namespace blink |
OLD | NEW |