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

Unified Diff: include/AdblockPlus/JsValue.h

Issue 29417624: Issue 5034 - Part 4: JsEngine::Evaluate() return a JsValue (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created April 19, 2017, 6:18 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 | « include/AdblockPlus/JsEngine.h ('k') | src/FilterEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/JsValue.h
===================================================================
--- a/include/AdblockPlus/JsValue.h
+++ b/include/AdblockPlus/JsValue.h
@@ -35,21 +35,16 @@
namespace AdblockPlus
{
class JsValue;
class JsEngine;
typedef std::shared_ptr<JsEngine> JsEnginePtr;
/**
- * Shared smart pointer to a `JsValue` instance.
- */
- typedef std::shared_ptr<JsValue> JsValuePtr;
sergei 2017/04/19 19:11:15 This is an achievement!
-
- /**
* List of JavaScript values.
*/
typedef std::vector<AdblockPlus::JsValue> JsValueList;
/**
* Wrapper for JavaScript values.
* See `JsEngine` for creating `JsValue` objects.
*/
@@ -117,21 +112,27 @@
* constructor.
* @return Class name of the value.
*/
std::string GetClass() const;
/**
* Invokes the value as a function (see `IsFunction()`).
* @param params Optional list of parameters.
- * @param thisPtr Optional `this` value.
* @return Value returned by the function.
*/
- JsValue Call(const JsValueList& params = JsValueList(),
- const AdblockPlus::JsValuePtr& thisPtr = AdblockPlus::JsValuePtr()) const;
+ JsValue Call(const JsValueList& params = JsValueList()) const;
+
+ /**
+ * Invokes the value as a method (see `IsFunction()`).
+ * @param params list of parameters.
+ * @param thisPtr `this` value.
+ * @return Value returned by the function.
+ */
+ JsValue Call(const JsValueList& params, const AdblockPlus::JsValue& thisValue) const;
/**
* Invokes the value as a function (see `IsFunction()`) with single
* parameter.
* @param arg A single required parameter.
* @return Value returned by the function.
*/
JsValue Call(const JsValue& arg) const;
« no previous file with comments | « include/AdblockPlus/JsEngine.h ('k') | src/FilterEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld