OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/inspector/v8-console.h" | 5 #include "src/inspector/v8-console.h" |
6 | 6 |
7 #include "src/base/macros.h" | 7 #include "src/base/macros.h" |
8 #include "src/inspector/injected-script.h" | 8 #include "src/inspector/injected-script.h" |
9 #include "src/inspector/inspected-context.h" | 9 #include "src/inspector/inspected-context.h" |
10 #include "src/inspector/string-util.h" | 10 #include "src/inspector/string-util.h" |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 " originAssert.apply(null, arguments);\n" | 733 " originAssert.apply(null, arguments);\n" |
734 " }\n" | 734 " }\n" |
735 "})"; | 735 "})"; |
736 | 736 |
737 v8::Local<v8::String> assertSource = toV8String(isolate, jsConsoleAssert); | 737 v8::Local<v8::String> assertSource = toV8String(isolate, jsConsoleAssert); |
738 V8InspectorImpl* inspector = inspectedContext->inspector(); | 738 V8InspectorImpl* inspector = inspectedContext->inspector(); |
739 v8::Local<v8::Value> setupFunction; | 739 v8::Local<v8::Value> setupFunction; |
740 if (inspector->compileAndRunInternalScript(context, assertSource) | 740 if (inspector->compileAndRunInternalScript(context, assertSource) |
741 .ToLocal(&setupFunction) && | 741 .ToLocal(&setupFunction) && |
742 setupFunction->IsFunction()) { | 742 setupFunction->IsFunction()) { |
743 inspector->callInternalFunction( | 743 v8::MicrotasksScope microtasksScope( |
744 v8::Local<v8::Function>::Cast(setupFunction), context, console, 0, | 744 isolate, v8::MicrotasksScope::kDoNotRunMicrotasks); |
745 nullptr); | 745 v8::MaybeLocal<v8::Value> result; |
| 746 result = v8::Local<v8::Function>::Cast(setupFunction) |
| 747 ->Call(context, console, 0, nullptr); |
746 } | 748 } |
747 | 749 |
748 if (hasMemoryAttribute) | 750 if (hasMemoryAttribute) |
749 console->SetAccessorProperty( | 751 console->SetAccessorProperty( |
750 toV8StringInternalized(isolate, "memory"), | 752 toV8StringInternalized(isolate, "memory"), |
751 v8::Function::New(context, V8Console::memoryGetterCallback, console, 0, | 753 v8::Function::New(context, V8Console::memoryGetterCallback, console, 0, |
752 v8::ConstructorBehavior::kThrow) | 754 v8::ConstructorBehavior::kThrow) |
753 .ToLocalChecked(), | 755 .ToLocalChecked(), |
754 v8::Function::New(context, V8Console::memorySetterCallback, | 756 v8::Function::New(context, V8Console::memorySetterCallback, |
755 v8::Local<v8::Value>(), 0, | 757 v8::Local<v8::Value>(), 0, |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 ->GetOwnPropertyDescriptor( | 945 ->GetOwnPropertyDescriptor( |
944 m_context, v8::Local<v8::String>::Cast(name)) | 946 m_context, v8::Local<v8::String>::Cast(name)) |
945 .ToLocal(&descriptor); | 947 .ToLocal(&descriptor); |
946 DCHECK(success); | 948 DCHECK(success); |
947 USE(success); | 949 USE(success); |
948 } | 950 } |
949 } | 951 } |
950 } | 952 } |
951 | 953 |
952 } // namespace v8_inspector | 954 } // namespace v8_inspector |
OLD | NEW |