non-string-primitive.js (567B)
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: If x is not a string value, return x 5 esid: sec-performeval 6 es5id: 15.1.2.1_A1.1_T1 7 description: Checking all primitives 8 ---*/ 9 10 var x = 1; 11 assert.sameValue((0,eval)(x), x, 'Reference'); 12 13 assert.sameValue((0,eval)(1), 1, 'number'); 14 15 assert.sameValue((0,eval)(true), true, 'boolean'); 16 17 assert.sameValue((0,eval)(null), null, 'null'); 18 19 assert.sameValue((0,eval)(undefined), undefined, 'undefined'); 20 21 reportCompare(0, 0);