Added extra javascript shared vars getVars() parameter indicating detection and return of boolean values.
This commit is contained in:
parent
6336ddffd3
commit
bde151edba
|
@ -3442,6 +3442,8 @@ bool JsShared::runNative(ObjList& stack, const ExpOperation& oper, GenObject* co
|
||||||
// js_props: Boolean. Force Javascript ExpOperation in returned result. Default: true
|
// js_props: Boolean. Force Javascript ExpOperation in returned result. Default: true
|
||||||
// autonum: Boolean. Force ExpOperation auto number in returned result. Default: false.
|
// autonum: Boolean. Force ExpOperation auto number in returned result. Default: false.
|
||||||
// Ignored if not returning ExpOperation
|
// Ignored if not returning ExpOperation
|
||||||
|
// autobool: Boolean. Detect booleans, put them in returned result. Default: false.
|
||||||
|
// Ignored if not returning ExpOperation
|
||||||
// prefix: String. Optional prefix for variables
|
// prefix: String. Optional prefix for variables
|
||||||
// skip_prefix: Boolean. Skip prefix when returned. Default: true. Ignored if prefix is empty
|
// skip_prefix: Boolean. Skip prefix when returned. Default: true. Ignored if prefix is empty
|
||||||
ObjList args;
|
ObjList args;
|
||||||
|
@ -3451,13 +3453,16 @@ bool JsShared::runNative(ObjList& stack, const ExpOperation& oper, GenObject* co
|
||||||
if (m_vars) {
|
if (m_vars) {
|
||||||
bool expOper = true;
|
bool expOper = true;
|
||||||
bool autoNum = false;
|
bool autoNum = false;
|
||||||
|
bool autoBool = false;
|
||||||
String prefix;
|
String prefix;
|
||||||
bool skipPrefix = true;
|
bool skipPrefix = true;
|
||||||
JsObject* params = YOBJECT(JsObject,pOp);
|
JsObject* params = YOBJECT(JsObject,pOp);
|
||||||
if (params) {
|
if (params) {
|
||||||
params->getBoolField(YSTRING("js_props"),expOper);
|
params->getBoolField(YSTRING("js_props"),expOper);
|
||||||
if (expOper)
|
if (expOper) {
|
||||||
params->getBoolField(YSTRING("autonum"),autoNum);
|
params->getBoolField(YSTRING("autonum"),autoNum);
|
||||||
|
params->getBoolField(YSTRING("autobool"),autoBool);
|
||||||
|
}
|
||||||
params->getStringField(YSTRING("prefix"),prefix);
|
params->getStringField(YSTRING("prefix"),prefix);
|
||||||
if (prefix)
|
if (prefix)
|
||||||
params->getBoolField(YSTRING("skip_prefix"),skipPrefix);
|
params->getBoolField(YSTRING("skip_prefix"),skipPrefix);
|
||||||
|
@ -3468,7 +3473,10 @@ bool JsShared::runNative(ObjList& stack, const ExpOperation& oper, GenObject* co
|
||||||
m_vars->copy(tmp,prefix,skipPrefix);
|
m_vars->copy(tmp,prefix,skipPrefix);
|
||||||
for (ObjList* o = tmp.paramList()->skipNull(); o; o = o->skipNext()) {
|
for (ObjList* o = tmp.paramList()->skipNull(); o; o = o->skipNext()) {
|
||||||
NamedString* ns = static_cast<NamedString*>(o->get());
|
NamedString* ns = static_cast<NamedString*>(o->get());
|
||||||
jso->params().addParam(new ExpOperation(*ns,ns->name(),autoNum));
|
if (autoBool && ns->isBoolean())
|
||||||
|
jso->params().addParam(new ExpOperation(ns->toBoolean(),ns->name()));
|
||||||
|
else
|
||||||
|
jso->params().addParam(new ExpOperation(*ns,ns->name(),autoNum));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue