mirror of
				https://github.com/tc39/test262.git
				synced 2025-10-31 19:53:50 +01:00 
			
		
		
		
	* Add missing generators feature flags * Generate files * Add generators flags * fixup! Add generators flags
		
			
				
	
	
		
			42 lines
		
	
	
		
			1001 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			1001 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| // This file was procedurally generated from the following sources:
 | |
| // - src/generators/yield-identifier-non-strict.case
 | |
| // - src/generators/non-strict/obj-method.template
 | |
| /*---
 | |
| description: Use of yield as a valid identifier in a function body inside a generator body in non strict mode (Generator method - valid for non-strict only cases)
 | |
| esid: prod-GeneratorMethod
 | |
| features: [generators]
 | |
| flags: [generated, noStrict]
 | |
| info: |
 | |
|     14.4 Generator Function Definitions
 | |
| 
 | |
|     GeneratorMethod[Yield, Await]:
 | |
|       * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
 | |
| 
 | |
| ---*/
 | |
| 
 | |
| var callCount = 0;
 | |
| 
 | |
| var gen = {
 | |
|   *method() {
 | |
|     callCount += 1;
 | |
|     return (function(arg) {
 | |
|         var yield = arg + 1;
 | |
|         return yield;
 | |
|       }(yield))
 | |
|   }
 | |
| }.method;
 | |
| 
 | |
| var iter = gen();
 | |
| 
 | |
| var item = iter.next();
 | |
| 
 | |
| assert.sameValue(item.done, false);
 | |
| assert.sameValue(item.value, undefined);
 | |
| 
 | |
| item = iter.next(42);
 | |
| 
 | |
| assert.sameValue(item.done, true);
 | |
| assert.sameValue(item.value, 43);
 | |
| 
 | |
| assert.sameValue(callCount, 1);
 |