summaryrefslogtreecommitdiff
path: root/addons/base/static/lib
diff options
context:
space:
mode:
authorFabien Meghazi <fme@openerp.com>2011-05-26 11:57:48 +0200
committerFabien Meghazi <fme@openerp.com>2011-05-26 11:57:48 +0200
commitd58a09deff2f07f3b07948344e82f1df539a3ac5 (patch)
tree4881cb34b6f33446dc0aa70cff98e393e4a2cc2f /addons/base/static/lib
parent341ab7762f9e6625a5e92b3b8e2c7a9a4599f58e (diff)
[IMP] t-set="" value is now considered as an expression allowing things like t-set="object.prop"
bzr revid: fme@openerp.com-20110526095748-z7g97pmfnpr14no3
Diffstat (limited to 'addons/base/static/lib')
-rw-r--r--addons/base/static/lib/qweb/qweb2.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/addons/base/static/lib/qweb/qweb2.js b/addons/base/static/lib/qweb/qweb2.js
index e5476d599bd..5067d30d70e 100644
--- a/addons/base/static/lib/qweb/qweb2.js
+++ b/addons/base/static/lib/qweb/qweb2.js
@@ -2,7 +2,7 @@
// TODO: line number -> https://bugzilla.mozilla.org/show_bug.cgi?id=618650
var QWeb2 = {
expressions_cache: {},
- reserved_words: 'true,false,NaN,null,undefined,debugger,in,instanceof,new,function,return,this,typeof,eval,Math,RegExp,Array,Object'.split(','),
+ reserved_words: 'true,false,NaN,null,undefined,debugger,in,instanceof,new,function,return,this,typeof,eval,Math,RegExp,Array,Object,Date'.split(','),
actions_precedence: 'foreach,if,call,set,esc,escf,raw,rawf,js,debug,log'.split(','),
word_replacement: {
'and': '&&',
@@ -635,17 +635,18 @@ QWeb2.Element = (function() {
}
},
compile_action_set : function(value) {
+ var variable = this.format_expression(value);
if (this.actions['value']) {
- this.top("dict['" + value + "'] = (" + (this.format_expression(this.actions['value'])) + ");");
+ this.top(variable + " = (" + (this.format_expression(this.actions['value'])) + ");");
this.process_children = false;
} else {
if (this.children.length === 0) {
- this.top("dict['" + value + "'] = '';");
+ this.top(variable + " = '';");
} else if (this.children.length === 1 && this.children[0].node.nodeType === 3) {
- this.top("dict['" + value + "'] = " + (this.engine.tools.js_escape(this.children[0].node.data)) + ";");
+ this.top(variable + " = " + (this.engine.tools.js_escape(this.children[0].node.data)) + ";");
this.process_children = false;
} else {
- this.top("dict['" + value + "'] = (function(dict) {");
+ this.top(variable + " = (function(dict) {");
this.bottom("})(dict);");
this.indent();
this.top("var r = [];");