summaryrefslogtreecommitdiff
path: root/addons/web/static/lib
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-12-12 11:38:25 +0100
committerChristophe Simonis <chs@odoo.com>2018-12-12 11:38:25 +0100
commitf351dd8cab980a67ee17c431574d8ba9c37b8fdc (patch)
tree2cb6e64d0a5083aade80206ea7fbfbcda69992b8 /addons/web/static/lib
parent1144235d06a2ad42060c05d4ece145ce46a660e1 (diff)
parent047e2b28de4653f11e097e6232d7fb79d54ce3af (diff)
[MERGE] forward port branch 12.0 up to 047e2b28de4
Diffstat (limited to 'addons/web/static/lib')
-rw-r--r--addons/web/static/lib/py.js/lib/py.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/addons/web/static/lib/py.js/lib/py.js b/addons/web/static/lib/py.js/lib/py.js
index 06d834321de..bd794323995 100644
--- a/addons/web/static/lib/py.js/lib/py.js
+++ b/addons/web/static/lib/py.js/lib/py.js
@@ -282,7 +282,10 @@ var py = {};
var name_pattern = new RegExp('^' + Name + '$');
var strip = new RegExp('^' + Whitespace);
return function tokenize(s) {
- var max=s.length, tokens = [], start, end = undefined;
+ s = s
+ .replace(/\\\"/g, '\\u0022') // for double quote
+ .replace(/\\\'/g, '\\u0027'); // for single quote
+ var max=s.length, tokens = [], start, end;
// /g flag makes repeated exec() have memory
var pseudoprog = new RegExp(PseudoToken, 'g');
@@ -302,7 +305,6 @@ var py = {};
end = pseudoprog.lastIndex;
// strip leading space caught by Whitespace
var token = s.slice(start, end).replace(strip, '');
- var initial = token[0];
if (number_pattern.test(token)) {
tokens.push(create(symbols['(number)'], {
@@ -310,9 +312,13 @@ var py = {};
}));
} else if (string_pattern.test(token)) {
var m = string_pattern.exec(token);
+ var value = (m[3] !== undefined ? m[3] : m[5]);
+ value
+ .replace(/\\u0022/g, '"')
+ .replace(/\\u0027/g, "'");
tokens.push(create(symbols['(string)'], {
unicode: !!(m[2] || m[4]),
- value: (m[3] !== undefined ? m[3] : m[5])
+ value: value
}));
} else if (token in symbols) {
var symbol;