Shaka Player Embedded
v8_utils.h
Go to the documentation of this file.
1 // Copyright 2016 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SHAKA_EMBEDDED_MAPPING_V8_V8_UTILS_H_
16 #define SHAKA_EMBEDDED_MAPPING_V8_V8_UTILS_H_
17 
18 #include <v8.h>
19 
20 #include <string>
21 
22 namespace shaka {
23 
29 v8::Isolate* GetIsolate();
30 
32 inline bool IsTrue(const v8::Maybe<bool>& value) {
33  return value.IsJust() && value.FromJust();
34 }
35 
37 void PrintStackTrace(const v8::Local<v8::StackTrace>& stack);
38 
43 void OnUncaughtException(const v8::Local<v8::Value>& exception,
44  bool in_promise);
45 
46 } // namespace shaka
47 
48 #endif // SHAKA_EMBEDDED_MAPPING_V8_V8_UTILS_H_
bool IsTrue(const v8::Maybe< bool > &value)
Definition: v8_utils.h:32
void OnUncaughtException(JSValueRef exception, bool in_promise)
Definition: jsc_utils.cc:28
void PrintStackTrace(const v8::Local< v8::StackTrace > &stack)
Definition: v8_utils.cc:31
v8::Isolate * GetIsolate()
Definition: v8_utils.cc:27