cptn-nrml-expr-prim.js (639B)
1 // Copyright (C) 2016 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 info: | 5 If Result(3).type is normal and its completion value is a value V, 6 then return the value V 7 esid: sec-performeval 8 es5id: 15.1.2.1_A3.1_T1 9 description: Expression statement. Eval return primitive value 10 ---*/ 11 12 var x; 13 assert.sameValue((0,eval)("x = 1"), 1, 'AssignmentExpression'); 14 15 assert.sameValue((0,eval)("1"), 1, 'NumericLiteral'); 16 17 assert.sameValue((0,eval)("'1'"), '1', 'StringLiteral'); 18 19 x = 1; 20 assert.sameValue((0,eval)("++x"), 2, 'UpdateExpression'); 21 22 reportCompare(0, 0);