S15.6.1.1_A1_T1.js (918B)
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 Returns a boolean value (not a Boolean object) computed by 7 ToBoolean(value) 8 esid: sec-terms-and-definitions-boolean-value 9 description: > 10 Used values 1, new String("1"), new Object(1) and called without 11 argument 12 ---*/ 13 assert.sameValue(typeof Boolean(), "boolean", 'The value of `typeof Boolean()` is expected to be "boolean"'); 14 assert.sameValue(typeof Boolean(1), "boolean", 'The value of `typeof Boolean(1)` is expected to be "boolean"'); 15 16 assert.sameValue( 17 typeof Boolean(new String("1")), 18 "boolean", 19 'The value of `typeof Boolean(new String("1"))` is expected to be "boolean"' 20 ); 21 22 assert.sameValue( 23 typeof Boolean(new Object(1)), 24 "boolean", 25 'The value of `typeof Boolean(new Object(1))` is expected to be "boolean"' 26 ); 27 28 reportCompare(0, 0);