| Index: src/Utils.cpp |
| =================================================================== |
| --- a/src/Utils.cpp |
| +++ b/src/Utils.cpp |
| @@ -21,16 +21,22 @@ |
| #include <Windows.h> |
| #include <Shlwapi.h> |
| #endif |
| #include "Utils.h" |
| using namespace AdblockPlus; |
| +void Utils::CheckTryCatch(v8::Isolate* isolate, const v8::TryCatch& tryCatch) |
| +{ |
| + if (tryCatch.HasCaught()) |
| + throw AdblockPlus::JsError(isolate, tryCatch.Exception(), tryCatch.Message()); |
| +} |
| + |
| std::string Utils::FromV8String(v8::Isolate* isolate, const v8::Local<v8::Value>& value) |
| { |
| v8::String::Utf8Value stringValue(isolate, value); |
| if (stringValue.length()) |
| return std::string(*stringValue, stringValue.length()); |
| else |
| return std::string(); |
| } |