Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/FileSystemJsObject.cpp

Issue 29418664: Issue 5162 - JsContext() takes a JsEngine& (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created April 20, 2017, 7:53 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ConsoleJsObject.cpp ('k') | src/FilterEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/FileSystemJsObject.cpp
===================================================================
--- a/src/FileSystemJsObject.cpp
+++ b/src/FileSystemJsObject.cpp
@@ -67,17 +67,17 @@
{
error = e.what();
}
catch (...)
{
error = "Unknown error while reading from " + path;
}
- const JsContext context(jsEngine);
+ const JsContext context(*jsEngine);
auto result = jsEngine->NewObject();
result.SetProperty("content", content);
result.SetProperty("error", error);
JsValueList params;
params.push_back(result);
callback.Call(params);
}
@@ -107,17 +107,17 @@
{
error = e.what();
}
catch (...)
{
error = "Unknown error while writing to " + path;
}
- const JsContext context(jsEngine);
+ const JsContext context(*jsEngine);
auto errorValue = jsEngine->NewValue(error);
JsValueList params;
params.push_back(errorValue);
callback.Call(params);
}
private:
std::string path;
@@ -144,17 +144,17 @@
{
error = e.what();
}
catch (...)
{
error = "Unknown error while moving " + fromPath + " to " + toPath;
}
- const JsContext context(jsEngine);
+ const JsContext context(*jsEngine);
auto errorValue = jsEngine->NewValue(error);
JsValueList params;
params.push_back(errorValue);
callback.Call(params);
}
private:
std::string fromPath;
@@ -181,17 +181,17 @@
{
error = e.what();
}
catch (...)
{
error = "Unknown error while removing " + path;
}
- const JsContext context(jsEngine);
+ const JsContext context(*jsEngine);
auto errorValue = jsEngine->NewValue(error);
JsValueList params;
params.push_back(errorValue);
callback.Call(params);
}
private:
std::string path;
@@ -219,17 +219,17 @@
{
error = e.what();
}
catch (...)
{
error = "Unknown error while calling stat on " + path;
}
- const JsContext context(jsEngine);
+ const JsContext context(*jsEngine);
auto result = jsEngine->NewObject();
result.SetProperty("exists", statResult.exists);
result.SetProperty("isFile", statResult.isFile);
result.SetProperty("isDirectory", statResult.isDirectory);
result.SetProperty("lastModified", statResult.lastModified);
result.SetProperty("error", error);
JsValueList params;
« no previous file with comments | « src/ConsoleJsObject.cpp ('k') | src/FilterEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld