parent
f57e580f2d
commit
b665478fa7
|
@ -317,10 +317,10 @@ var py = {};
|
|||
} else if (token in symbols) {
|
||||
var symbol;
|
||||
// transform 'not in' and 'is not' in a single token
|
||||
if (token === 'in' && tokens[tokens.length-1].id === 'not') {
|
||||
if (token === 'in' && tokens.length > 1 && tokens[tokens.length-1].id === 'not') {
|
||||
symbol = symbols['not in'];
|
||||
tokens.pop();
|
||||
} else if (token === 'not' && tokens[tokens.length-1].id === 'is') {
|
||||
} else if (token === 'not' && tokens.length > 1 && tokens[tokens.length-1].id === 'is') {
|
||||
symbol = symbols['is not'];
|
||||
tokens.pop();
|
||||
} else {
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
openerp.testing.section('eval.basics', {
|
||||
dependencies: ['web.core'],
|
||||
setup: function (instance) {
|
||||
instance.session.uid = 42;
|
||||
}
|
||||
}, function (test) {
|
||||
test('not prefix', function (instance) {
|
||||
ok(py.eval('not False'));
|
||||
ok(py.eval('not foo', {foo: false}));
|
||||
ok(py.eval('not a in b', {a: 3, b: [1, 2, 4, 8]}));
|
||||
});
|
||||
});
|
||||
|
||||
openerp.testing.section('eval.types', {
|
||||
dependencies: ['web.core'],
|
||||
setup: function (instance) {
|
||||
|
|
Loading…
Reference in New Issue