S11.5.3_A3_T2.7.js (929B)
1 // Copyright 2009 the Sputnik authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 info: Operator x % y returns ToNumber(x) % ToNumber(y) 6 es5id: 11.5.3_A3_T2.7 7 description: > 8 Type(x) is different from Type(y) and both types vary between 9 String (primitive or object) and Null 10 ---*/ 11 12 //CHECK#1 13 if (isNaN("1" % null) !== true) { 14 throw new Test262Error('#1: "1" % null === Not-a-Number. Actual: ' + ("1" % null)); 15 } 16 17 //CHECK#2 18 if (null % "1" !== 0) { 19 throw new Test262Error('#2: null % "1" === 0. Actual: ' + (null % "1")); 20 } 21 22 //CHECK#3 23 if (isNaN(new String("1") % null) !== true) { 24 throw new Test262Error('#3: new String("1") % null === Not-a-Number. Actual: ' + (new String("1") % null)); 25 } 26 27 //CHECK#4 28 if (null % new String("1") !== 0) { 29 throw new Test262Error('#4: null % new String("1") === 0. Actual: ' + (null % new String("1"))); 30 } 31 32 reportCompare(0, 0);