Ticket #48 (closed bug: fixed)

Opened 8 years ago

Last modified 8 years ago

py2js parentheses bug

Reported by: Hemml Owned by: apoirier
Priority: critical Component: uncategorized
Version: Keywords: py2js
Cc:

Description

in if-statements some parentheses can be lost.
This code:

if a==b or (c==d and d==e):

alert("QQ")

translates to:

if ((a == b)
(c == d) && (d == e)) {

alert("QQ");

}

but must be translated to:

if ((a == b)
((c == d) && (d == e))) {

alert("QQ");

}

Change History

comment:1 Changed 8 years ago by apoirier

  • Status changed from new to closed
  • Resolution set to fixed

(In [5bced6e5760a46904dc6a4595455069c3e4e9d10]) Fixes #48.
Boolean expressions parenthesis handling backported from the lastest version of pyjs.

Note: See TracTickets for help on using tickets.