|
60 | 60 |
|
61 | 61 | // TODO: static calls to static methods do not trigger "musts" dependency |
62 | 62 |
|
| 63 | +// BH 9/8/2017 -- primitive numeric casting -- (byte) was ignored so that (byte) 0xFF remained 0xFF. |
63 | 64 | // BH 9/7/2017 -- fixed multiple issues with char and Character |
64 | 65 | // BH 9/4/2017 -- java.awt, javax.swing, swingjs code added; additional fixes required |
65 | 66 | // BH 8/30/2017 -- all i/o working, including printf and FileOutputStream |
@@ -90,26 +91,6 @@ interface Editable { |
90 | 91 | class EditDialog extends Dialog implements AdjustmentListener, ActionListener, ItemListener { |
91 | 92 | ... |
92 | 93 |
|
93 | | -TODO #21 (byte) ignored so that 0xFF remains 0xFF. |
94 | | -
|
95 | | -With the implementation of Int8Array in j2sJmol, it becomes more important to consider |
96 | | -the issue of no byte type in JavaScript. In particular, the construction |
97 | | -
|
98 | | - bytes[3] == (byte) 0xFF |
99 | | -
|
100 | | -is being translated as |
101 | | -
|
102 | | - bytes[3] == 0xFF |
103 | | -
|
104 | | -and will evaluate FALSE since JavaScript Int8Array elements cannot have value 255. |
105 | | -
|
106 | | -The solution is to recast the byte as an integer, not the other way around: |
107 | | -
|
108 | | - (bytes[3] & 0xFF) == 0xFF |
109 | | -
|
110 | | -which now works for both Java and JavaScript. |
111 | | - |
112 | | - |
113 | 94 | TODO #16 when an inner public class is called by another class using instanceOf, that inner class becomes an optional load. |
114 | 95 | but optional loads must still be loaded, and unless declared in package.js, J2S will look for xxx.xxx.Outer/Inner.js |
115 | 96 | because the inner classes are not fully declared. |
|
0 commit comments