mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 22:02:44 +00:00 
			
		
		
		
	LibJS: Always init arguments stored in locals for generator functions
Since AST interpreter switches to bytecode to execute generator functions, arguments stored in local variables always need to be initialized for such functions.
This commit is contained in:
		
							parent
							
								
									e5b70837de
								
							
						
					
					
						commit
						71c54dd37b
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -479,7 +479,7 @@ ThrowCompletionOr<void> ECMAScriptFunctionObject::function_declaration_instantia | ||||||
|                 Environment* used_environment = has_duplicates ? nullptr : environment; |                 Environment* used_environment = has_duplicates ? nullptr : environment; | ||||||
| 
 | 
 | ||||||
|                 if constexpr (IsSame<NonnullRefPtr<Identifier const> const&, decltype(param)>) { |                 if constexpr (IsSame<NonnullRefPtr<Identifier const> const&, decltype(param)>) { | ||||||
|                     if (vm.bytecode_interpreter_if_exists() && param->is_local()) { |                     if ((vm.bytecode_interpreter_if_exists() || kind() == FunctionKind::Generator) && param->is_local()) { | ||||||
|                         // NOTE: Local variables are supported only in bytecode interpreter
 |                         // NOTE: Local variables are supported only in bytecode interpreter
 | ||||||
|                         callee_context.local_variables[param->local_variable_index()] = argument_value; |                         callee_context.local_variables[param->local_variable_index()] = argument_value; | ||||||
|                         return {}; |                         return {}; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Aliaksandr Kalenik
						Aliaksandr Kalenik