mirror of
				https://github.com/tc39/test262.git
				synced 2025-10-31 19:53:50 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			28 lines
		
	
	
		
			494 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			494 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| // Reviewed
 | |
| //@ runDefault
 | |
| 
 | |
| (function thingy() {
 | |
|     function bar()
 | |
|     {
 | |
|         return bar.caller;
 | |
|     }
 | |
|     
 | |
|     class C {
 | |
|         *foo()
 | |
|         {
 | |
|             bar();
 | |
|         }
 | |
|     }
 | |
|         
 | |
|     var ok = false;
 | |
|     try {
 | |
|         new C().foo().next();
 | |
|         ok = true;
 | |
|     } catch (e) {
 | |
|         if (e.toString() != "TypeError: Function.caller used to retrieve generator body")
 | |
|             throw "Error: bad error: " + e;
 | |
|     }
 | |
|     if (ok)
 | |
|         throw "Error: did not throw error";
 | |
| })();
 |