Skip to content

Commit f97a9ad

Browse files
authored
Merge pull request #698 from NativeScript/pete/patch-devtools-console-crash
Patch devtools console crash
2 parents c718ef9 + 0bedfa7 commit f97a9ad

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

runtime/src/main/jni/v8_inspector/src/inspector/v8-debugger.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ std::unique_ptr<V8StackTraceImpl> V8Debugger::createStackTrace(
894894
v8::Local<v8::StackTrace> stackTrace) {
895895
int contextGroupId =
896896
m_isolate->InContext() ? getGroupId(m_isolate->GetCurrentContext()) : 0;
897-
return V8StackTraceImpl::create(this, contextGroupId, stackTrace,
897+
return V8StackTraceImpl::create(m_isolate, this, contextGroupId, stackTrace,
898898
V8StackTraceImpl::maxCallStackSizeToCapture);
899899
}
900900

runtime/src/main/jni/v8_inspector/src/inspector/v8-stack-trace-impl.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ void V8StackTraceImpl::setCaptureStackTraceForUncaughtExceptions(
105105
}
106106

107107
// static
108-
std::unique_ptr<V8StackTraceImpl> V8StackTraceImpl::create(
108+
std::unique_ptr<V8StackTraceImpl> V8StackTraceImpl::create(v8::Isolate *isolate,
109109
V8Debugger* debugger, int contextGroupId,
110110
v8::Local<v8::StackTrace> stackTrace, size_t maxStackSize,
111111
const String16& description) {
112-
v8::Isolate* isolate = v8::Isolate::GetCurrent();
112+
113113
v8::HandleScope scope(isolate);
114114
std::vector<V8StackTraceImpl::Frame> frames;
115115
if (!stackTrace.IsEmpty())
@@ -170,7 +170,7 @@ std::unique_ptr<V8StackTraceImpl> V8StackTraceImpl::capture(
170170
stackTrace = v8::StackTrace::CurrentStackTrace(
171171
isolate, static_cast<int>(maxStackSize), stackTraceOptions);
172172
}
173-
return V8StackTraceImpl::create(debugger, contextGroupId, stackTrace,
173+
return V8StackTraceImpl::create(isolate, debugger, contextGroupId, stackTrace,
174174
maxStackSize, description);
175175
}
176176

@@ -247,7 +247,7 @@ V8StackTraceImpl::buildInspectorObjectForTail(V8Debugger* debugger) const {
247247
v8::HandleScope handleScope(v8::Isolate::GetCurrent());
248248
// Next call collapses possible empty stack and ensures
249249
// maxAsyncCallChainDepth.
250-
std::unique_ptr<V8StackTraceImpl> fullChain = V8StackTraceImpl::create(
250+
std::unique_ptr<V8StackTraceImpl> fullChain = V8StackTraceImpl::create(v8::Isolate::GetCurrent(),
251251
debugger, m_contextGroupId, v8::Local<v8::StackTrace>(),
252252
V8StackTraceImpl::maxCallStackSizeToCapture);
253253
if (!fullChain || !fullChain->m_parent) return nullptr;

runtime/src/main/jni/v8_inspector/src/inspector/v8-stack-trace-impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class V8StackTraceImpl final : public V8StackTrace {
5454

5555
static void setCaptureStackTraceForUncaughtExceptions(v8::Isolate*,
5656
bool capture);
57-
static std::unique_ptr<V8StackTraceImpl> create(
57+
static std::unique_ptr<V8StackTraceImpl> create(v8::Isolate* isolate,
5858
V8Debugger*, int contextGroupId, v8::Local<v8::StackTrace>,
5959
size_t maxStackSize, const String16& description = String16());
6060
static std::unique_ptr<V8StackTraceImpl> capture(

tools/astyle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const validFiles = ['c', 'cpp', 'h', 'java'];
88
// let dateString = `${date.getDay() + 1}-${date.getMonth() + 1}-${date.getFullYear()}--${date.getHours()}:${date.getMinutes()}`
99
// let backupDir = `formatbackup-${dateString}`;
1010

11-
let astyleOptions = "--style=java -H -k1 -j -C -s4 -xi -n" // "--options=tools\\.astyle"
11+
let astyleOptions = "--style=java -H -k1 -j -C -s4 -xi -n --exclude=\"runtime/src/main/jni/include\" --exclude=\"runtime/src/main/jni/v8_inspector\"" // "--options=tools\\.astyle"
1212
let astyle = "astyle";
1313

1414
if (process.platform.indexOf("win") === 0) {

0 commit comments

Comments
 (0)