ScriptCore: throw exceptions correctly

This commit is contained in:
anthony taranto
2012-02-27 14:11:53 -08:00
parent ba68821d91
commit c6494319ef
4 changed files with 8 additions and 12 deletions
+1 -3
View File
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Threading;
using NUnit.Framework;
using System.Collections.Generic;
namespace CefSharp.Test
{
@@ -15,7 +14,6 @@ namespace CefSharp.Test
Assert.AreEqual(result, Fixture.Browser.EvaluateScript(script));
}
[Ignore]
[TestCase("!!!")]
public void EvaluateScriptExceptionTest(string script)
{
+6 -7
View File
@@ -32,7 +32,7 @@ namespace CefSharp
if (exception)
{
CefString message = exception->GetMessage();
_exception = gcnew ScriptException(toClr(message));
_exception = toClr(message);
}
else
{
@@ -40,9 +40,9 @@ namespace CefSharp
{
_result = convertFromCef(result);
}
catch (...)
catch (Exception^ ex)
{
_exception = ex->Message;
}
}
}
@@ -69,9 +69,8 @@ namespace CefSharp
gcroot<Object^> ScriptCore::Evaluate(CefRefPtr<CefFrame> frame, CefString script, double timeout)
{
AutoLock lock_scope(this);
//_result = nullptr;
//_exception = nullptr;
_result = nullptr;
_exception = nullptr;
if (CefCurrentlyOn(TID_UI))
{
@@ -90,7 +89,7 @@ namespace CefSharp
if (_exception)
{
throw _exception;
throw gcnew ScriptException(_exception);
}
else
{
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CefSharp
HANDLE _event;
gcroot<Object^> _result;
gcroot<Exception^> _exception;
gcroot<String^> _exception;
void UIT_Execute(CefRefPtr<CefFrame> frame, CefString script);
void UIT_Evaluate(CefRefPtr<CefFrame> frame, CefString script);
-1
View File
@@ -13,5 +13,4 @@ namespace CefSharp
: Exception(message)
{}
};
}