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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast( | 54 v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast( |
55 callFrame->Get(context, toV8StringInternalized(m_isolate, name)) | 55 callFrame->Get(context, toV8StringInternalized(m_isolate, name)) |
56 .ToLocalChecked()); | 56 .ToLocalChecked()); |
57 v8::Local<v8::Value> result; | 57 v8::Local<v8::Value> result; |
58 if (!func->Call(context, callFrame, 0, nullptr).ToLocal(&result) || | 58 if (!func->Call(context, callFrame, 0, nullptr).ToLocal(&result) || |
59 !result->IsInt32()) | 59 !result->IsInt32()) |
60 return 0; | 60 return 0; |
61 return result.As<v8::Int32>()->Value(); | 61 return result.As<v8::Int32>()->Value(); |
62 } | 62 } |
63 | 63 |
64 int JavaScriptCallFrame::sourceID() const { | |
65 return callV8FunctionReturnInt("sourceID"); | |
66 } | |
67 | |
68 int JavaScriptCallFrame::line() const { | |
69 return callV8FunctionReturnInt("line"); | |
70 } | |
71 | |
72 int JavaScriptCallFrame::column() const { | |
73 return callV8FunctionReturnInt("column"); | |
74 } | |
75 | |
76 int JavaScriptCallFrame::contextId() const { | 64 int JavaScriptCallFrame::contextId() const { |
77 return callV8FunctionReturnInt("contextId"); | 65 return callV8FunctionReturnInt("contextId"); |
78 } | 66 } |
79 | 67 |
80 bool JavaScriptCallFrame::isAtReturn() const { | 68 bool JavaScriptCallFrame::isAtReturn() const { |
81 v8::HandleScope handleScope(m_isolate); | 69 v8::HandleScope handleScope(m_isolate); |
82 v8::Local<v8::Context> context = | 70 v8::Local<v8::Context> context = |
83 v8::Local<v8::Context>::New(m_isolate, m_debuggerContext); | 71 v8::Local<v8::Context>::New(m_isolate, m_debuggerContext); |
84 v8::Local<v8::Object> callFrame = | 72 v8::Local<v8::Object> callFrame = |
85 v8::Local<v8::Object>::New(m_isolate, m_callFrame); | 73 v8::Local<v8::Object>::New(m_isolate, m_callFrame); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 .ToLocalChecked()); | 146 .ToLocalChecked()); |
159 v8::Local<v8::Value> argv[] = { | 147 v8::Local<v8::Value> argv[] = { |
160 v8::Local<v8::Value>(v8::Integer::New(m_isolate, scopeNumber)), | 148 v8::Local<v8::Value>(v8::Integer::New(m_isolate, scopeNumber)), |
161 variableName, newValue}; | 149 variableName, newValue}; |
162 v8::TryCatch try_catch(m_isolate); | 150 v8::TryCatch try_catch(m_isolate); |
163 return setVariableValueFunction->Call(context, callFrame, arraysize(argv), | 151 return setVariableValueFunction->Call(context, callFrame, arraysize(argv), |
164 argv); | 152 argv); |
165 } | 153 } |
166 | 154 |
167 } // namespace v8_inspector | 155 } // namespace v8_inspector |
OLD | NEW |