S12.4_A2_T2.js (1152B)
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: | 6 The production ExpressionStatement : [lookahead \notin {{, function}] Expression; is evaluated as follows: 7 1. Evaluate Expression. 8 2. Call GetValue(Result(1)). 9 3. Return (normal, Result(2), empty) 10 es5id: 12.4_A2_T2 11 description: Checking by using eval(eval(x), where x is any string) 12 ---*/ 13 14 var x, __evaluated; 15 16 x="5+1|0===0"; 17 18 __evaluated = eval(x); 19 20 ////////////////////////////////////////////////////////////////////////////// 21 //CHECK#1 22 if (__evaluated !== 7) { 23 throw new Test262Error('#1: __evaluated === 7. Actual: __evaluated ==='+ __evaluated ); 24 } 25 // 26 ////////////////////////////////////////////////////////////////////////////// 27 28 __evaluated = eval("2*"+x+">-1"); 29 30 ////////////////////////////////////////////////////////////////////////////// 31 //CHECK#2 32 if (__evaluated !== 11) { 33 throw new Test262Error('#2: __evaluated === 11. Actual: __evaluated ==='+ __evaluated ); 34 } 35 // 36 ////////////////////////////////////////////////////////////////////////////// 37 38 reportCompare(0, 0);