-
Sub-task
-
Resolution: Fixed
-
P3
-
8
-
None
-
b100
-
generic
-
generic
-
Verified
ECMA section 11.4.8 - Bit Not operator "~" is a unary operator. Nashorn treats it as binary operator in certain circumstances.
Syntax error expected - but crashes inside code generator:
jjs> (function(){if(1~0)return 0; return 1})()
> Exception in thread "main" java.lang.AssertionError: node 1 ~ 0 class jdk.nashorn.internal.ir.BinaryNode has no symbol! [int] function _L1()
jjs> ""~""
>> Exception in thread "main" java.lang.AssertionError: "" ~ "" has no type
Valid case - but crashes in code generator:
>> jjs> Function(" 0 \n ~ 2 \n ~ 1")()
>> Exception in thread "main" java.lang.AssertionError: 2 ~ 1 has no type
Syntax error expected - but crashes inside code generator:
jjs> (function(){if(1~0)return 0; return 1})()
> Exception in thread "main" java.lang.AssertionError: node 1 ~ 0 class jdk.nashorn.internal.ir.BinaryNode has no symbol! [int] function _L1()
jjs> ""~""
>> Exception in thread "main" java.lang.AssertionError: "" ~ "" has no type
Valid case - but crashes in code generator:
>> jjs> Function(" 0 \n ~ 2 \n ~ 1")()
>> Exception in thread "main" java.lang.AssertionError: 2 ~ 1 has no type