OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 <errno.h> | 5 #include <errno.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <string.h> | 7 #include <string.h> |
8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1800 .ToLocalChecked(); | 1800 .ToLocalChecked(); |
1801 Local<String> callback_name = | 1801 Local<String> callback_name = |
1802 v8::String::NewFromUtf8(isolate_, "receive", v8::NewStringType::kNormal) | 1802 v8::String::NewFromUtf8(isolate_, "receive", v8::NewStringType::kNormal) |
1803 .ToLocalChecked(); | 1803 .ToLocalChecked(); |
1804 Local<Context> context = context_.Get(isolate_); | 1804 Local<Context> context = context_.Get(isolate_); |
1805 Local<Value> callback = | 1805 Local<Value> callback = |
1806 context->Global()->Get(context, callback_name).ToLocalChecked(); | 1806 context->Global()->Get(context, callback_name).ToLocalChecked(); |
1807 if (callback->IsFunction()) { | 1807 if (callback->IsFunction()) { |
1808 v8::TryCatch try_catch(isolate_); | 1808 v8::TryCatch try_catch(isolate_); |
1809 Local<Value> args[] = {message}; | 1809 Local<Value> args[] = {message}; |
1810 if (Local<Function>::Cast(callback) | 1810 MaybeLocal<Value> result = Local<Function>::Cast(callback)->Call( |
1811 ->Call(context, Undefined(isolate_), 1, args) | 1811 context, Undefined(isolate_), 1, args); |
1812 .IsEmpty()) { | 1812 CHECK(!result.IsEmpty()); // Listeners may not throw. |
1813 try_catch.ReThrow(); | |
1814 } | |
1815 } | 1813 } |
1816 } | 1814 } |
1817 | 1815 |
1818 Isolate* isolate_; | 1816 Isolate* isolate_; |
1819 Global<Context> context_; | 1817 Global<Context> context_; |
1820 }; | 1818 }; |
1821 | 1819 |
1822 class InspectorClient : public v8_inspector::V8InspectorClient { | 1820 class InspectorClient : public v8_inspector::V8InspectorClient { |
1823 public: | 1821 public: |
1824 InspectorClient(Local<Context> context, bool connect) { | 1822 InspectorClient(Local<Context> context, bool connect) { |
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2948 } | 2946 } |
2949 | 2947 |
2950 } // namespace v8 | 2948 } // namespace v8 |
2951 | 2949 |
2952 | 2950 |
2953 #ifndef GOOGLE3 | 2951 #ifndef GOOGLE3 |
2954 int main(int argc, char* argv[]) { | 2952 int main(int argc, char* argv[]) { |
2955 return v8::Shell::Main(argc, argv); | 2953 return v8::Shell::Main(argc, argv); |
2956 } | 2954 } |
2957 #endif | 2955 #endif |
OLD | NEW |