test/mjsunit/es7/exponentiation-operator.js
// found in the LICENSE file.
found in the LICENSE file.
found in the LICENSE file .
function TestBasic() {
  assertEquals(-(8 ** 2), -64);
  assertEquals(+(8 ** 2), 64);
  assertEquals(~(8 ** 2), -65);
  assertEquals(!(8 ** 2), false);
  assertEquals(2 ** -2, 0.25);
  var o = { p: 1 };
  assertEquals(2 ** delete o.p, 2);
  assertEquals(2 ** void 1, NaN);
  assertEquals(2 ** typeof 1, NaN);
  var s = "2";
  var n = 2;
  assertEquals(2 ** "2", 4);
  assertEquals(2 ** +"2", 4);
  assertEquals(2 ** +s, 4);
  assertEquals(2 ** s, 4);
  assertEquals(2 ** 2, 4);
  assertEquals(2 ** +2, 4);
  assertEquals(2 ** +n, 4);
  assertEquals(2 ** n, 4);
  assertEquals(2 ** -"2", 0.25);
  assertEquals(2 ** -s, 0.25);
  assertEquals(2 ** -2, 0.25);
  assertEquals(2 ** -n, 0.25);
  assertEquals(2 ** ~"2", 0.125);
  assertEquals(2 ** ~s, 0.125);
  assertEquals(2 ** ~2, 0.125);
  assertEquals(2 ** ~n, 0.125);
  assertEquals(2 ** !"2", 1);
  assertEquals(2 ** !s, 1);
  assertEquals(2 ** !2, 1);
  assertEquals(2 ** !n, 1);
 var exponent = 2;
 assertEquals(2 ** 3, 8);
 assertEquals(3 * 2 ** 3, 24);
 assertEquals(2 ** ++exponent, 8);
 assertEquals(2 ** -1 * 2, 1);
 assertEquals(2 ** 2 * 4, 16);
 assertEquals(2 ** 2 / 2, 2);
 assertEquals(2 ** (3 ** 2), 512);
 assertEquals(2 ** 3 ** 2, 512);
 assertEquals(2 * 3 ** 2, 18);
 assertEquals(16 / 2 ** 2, 4);
}
function TestBasic ( ) { assertEquals ( - ( 8 ** 2 ) , - 64 ) ; assertEquals ( + ( 8 ** 2 ) , 64 ) ; assertEquals ( ~ ( 8 ** 2 ) , - 65 ) ; assertEquals ( ! ( 8 ** 2 ) , false ) ; assertEquals ( 2 ** - 2 , 0.25 ) ; var o = { p : 1 } ; assertEquals ( 2 ** delete o . p , 2 ) ; assertEquals ( 2 ** void 1 , NaN ) ; assertEquals ( 2 ** typeof 1 , NaN ) ; var s = "2" ; var n = 2 ; assertEquals ( 2 ** "2" , 4 ) ; assertEquals ( 2 ** + "2" , 4 ) ; assertEquals ( 2 ** + s , 4 ) ; assertEquals ( 2 ** s , 4 ) ; assertEquals ( 2 ** 2 , 4 ) ; assertEquals ( 2 ** + 2 , 4 ) ; assertEquals ( 2 ** + n , 4 ) ; assertEquals ( 2 ** n , 4 ) ; assertEquals ( 2 ** - "2" , 0.25 ) ; assertEquals ( 2 ** - s , 0.25 ) ; assertEquals ( 2 ** - 2 , 0.25 ) ; assertEquals ( 2 ** - n , 0.25 ) ; assertEquals ( 2 ** ~ "2" , 0.125 ) ; assertEquals ( 2 ** ~ s , 0.125 ) ; assertEquals ( 2 ** ~ 2 , 0.125 ) ; assertEquals ( 2 ** ~ n , 0.125 ) ; assertEquals ( 2 ** ! "2" , 1 ) ; assertEquals ( 2 ** ! s , 1 ) ; assertEquals ( 2 ** ! 2 , 1 ) ; assertEquals ( 2 ** ! n , 1 ) ; var exponent = 2 ; assertEquals ( 2 ** 3 , 8 ) ; assertEquals ( 3 * 2 ** 3 , 24 ) ; assertEquals ( 2 ** ++ exponent , 8 ) ; assertEquals ( 2 ** - 1 * 2 , 1 ) ; assertEquals ( 2 ** 2 * 4 , 16 ) ; assertEquals ( 2 ** 2 / 2 , 2 ) ; assertEquals ( 2 ** ( 3 ** 2 ) , 512 ) ; assertEquals ( 2 ** 3 ** 2 , 512 ) ; assertEquals ( 2 * 3 ** 2 , 18 ) ; assertEquals ( 16 / 2 ** 2 , 4 ) ; }
found in the LICENSE file.
found in the LICENSE file .