Skip to content

Commit

Permalink
Simplification des traitements sur les boucles
Browse files Browse the repository at this point in the history
  • Loading branch information
arno06 committed Dec 7, 2016
1 parent 9f35d6c commit d3f4172
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
19 changes: 0 additions & 19 deletions src/Template.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,25 +195,6 @@ class Template extends EventEmitter
continue;
empty = false;
let v = blc;
while(v.indexOf(val)>-1)
v = v.replace(val, d[j]);
let tmp = v;
while(vr = re.exec(v))//Keep exec on "v" and replacing on "tmp" (loosing string index)
{
vr[1] = vr[1].substr(1, vr[1].length-1);
tmp = tmp.replace(vr[0], this._getVariable(vr[1], d[j]));
}
v = tmp.replace(key, t_0+(params[2]||"$v")+"."+c_key+t_1);
v = v.replace("$"+c_key, (params[2]||"$v")+"."+c_key);
let tof = (typeof d[j]).toLowerCase();
if(tof == "string" ||tof == "number" || tof == "boolean" || d[j] === null)
{
tmp = d[j];
d[j] = {};
d[j][(params[2]||"$v")] = tmp;
}
d[j][c_key] = j;

let dataCloned = Object.assign({}, pData);//Data cloning
dataCloned[(params[2]||"$v").replace("$", "")] = d[j];
dataCloned[c_key] = j;
Expand Down
18 changes: 0 additions & 18 deletions src/es5.Template.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,24 +177,6 @@ Class.define(Template, [EventDispatcher],
continue;
empty = false;
v = blc;
while(v.indexOf(val)>-1)
v = v.replace(val, d[j]);
tmp = v;
while(vr = re.exec(v))//Keep exec on "v" and replacing on "tmp" (loosing string index)
{
vr[1] = vr[1].substr(1, vr[1].length-1);
tmp = tmp.replace(vr[0], this._getVariable(vr[1], d[j]));
}
v = tmp.replace(key, t_0+(params[2]||"$v")+"."+c_key+t_1);
v = v.replace("$"+c_key, (params[2]||"$v")+"."+c_key);
if(typeof d[j] == "string" || typeof d[j] == "number" || typeof d[j] == "boolean" || d[j] === null)
{
tmp = d[j];
d[j] = {};
d[j][(params[2]||"$v")] = tmp;
}
d[j][c_key] = j;

var dataCloned = Object.clone(pData);
dataCloned[(params[2]||"$v").replace("$", "")] = d[j];
dataCloned[c_key] = j;
Expand Down

0 comments on commit d3f4172

Please sign in to comment.