S11.4.2_A4_T6.js (577B)
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 "void" evaluates UnaryExpression and returns undefined 6 es5id: 11.4.2_A4_T6 7 description: Checking Simple Assignment operator 8 ---*/ 9 10 //CHECK#1 11 var x = 0; 12 if (void (x = 1) !== undefined) { 13 throw new Test262Error('#1: var x = 0; void (x = 1) === undefined. Actual: ' + (void (x = 1))); 14 } else { 15 if (x !== 1) { 16 throw new Test262Error('#1: var x = 0; void (x = 1); x === 1. Actual: ' + (x)); 17 } 18 } 19 20 reportCompare(0, 0);