mirror of
				https://github.com/tc39/test262.git
				synced 2025-10-30 19:24:12 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			405 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			405 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| function shouldBe(actual, expected)
 | |
| {
 | |
|     if (actual !== expected)
 | |
|         throw new Error('bad value: ' + actual);
 | |
| }
 | |
| noInline(shouldBe);
 | |
| 
 | |
| function test(value)
 | |
| {
 | |
|     return Object.prototype.toString.call(value);
 | |
| }
 | |
| noInline(test);
 | |
| 
 | |
| var object = {};
 | |
| for (var i = 0; i < 1e5; ++i)
 | |
|     shouldBe(test(object), `[object Object]`);
 | |
| object[Symbol.toStringTag] = "Hello";
 | |
| shouldBe(test(object), `[object Hello]`);
 |