Skip to content

Commit e76a1ac

Browse files
committed
[js] Implement nqp::bitneg_i.
1 parent 102b4c2 commit e76a1ac

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/vm/js/QAST/Compiler.nqp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,8 @@ class QAST::OperationsJS {
460460
add_infix_op('bitshiftl_i', $T_INT, '<<', $T_INT, $T_INT);
461461
add_infix_op('bitshiftr_i', $T_INT, '>>', $T_INT, $T_INT);
462462

463+
add_simple_op('bitneg_i', $T_INT, [$T_INT], sub ($n) {"(~$n)"});
464+
463465
add_infix_op('eqaddr', $T_OBJ, '===', $T_OBJ, $T_BOOL);
464466

465467
# Integer arithmetic

0 commit comments

Comments
 (0)