mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-10-31 13:20:59 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			40 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| load("test-common.js");
 | |
| 
 | |
| try {
 | |
|     assert(Boolean.length === 1);
 | |
|     assert(Boolean.name === "Boolean");
 | |
|     assert(Boolean.prototype.length === undefined);
 | |
| 
 | |
|     assert(typeof new Boolean() === "object");
 | |
|     assert(new Boolean().valueOf() === false);
 | |
| 
 | |
|     var foo = new Boolean(true);
 | |
|     var bar = new Boolean(true);
 | |
| 
 | |
|     assert(foo !== bar);
 | |
|     assert(foo.valueOf() === bar.valueOf());
 | |
| 
 | |
|     assert(new Boolean(true).toString() === "true");
 | |
|     assert(new Boolean(false).toString() === "false");
 | |
| 
 | |
|     assert(typeof Boolean() === "boolean");
 | |
|     assert(typeof Boolean(true) === "boolean");
 | |
| 
 | |
|     assert(Boolean() === false);
 | |
|     assert(Boolean(false) === false);
 | |
|     assert(Boolean(null) === false);
 | |
|     assert(Boolean(undefined) === false);
 | |
|     assert(Boolean(NaN) === false);
 | |
|     assert(Boolean("") === false);
 | |
|     assert(Boolean(0.0) === false);
 | |
|     assert(Boolean(-0.0) === false);
 | |
|     assert(Boolean(true) === true);
 | |
|     assert(Boolean("0") === true);
 | |
|     assert(Boolean({}) === true);
 | |
|     assert(Boolean([]) === true);
 | |
|     assert(Boolean(1)) === true;
 | |
| 
 | |
|     console.log("PASS");
 | |
| } catch (err) {
 | |
|     console.log("FAIL: " + err);
 | |
| }
 | 
