mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:22:45 +00:00 
			
		
		
		
	LibJS: Mark two JS::Reference functions const
				
					
				
			These two are inherently const, and the next commit needs to call them on a const object, so let's just mark them const.
This commit is contained in:
		
							parent
							
								
									fbb31b4519
								
							
						
					
					
						commit
						f7a68ae998
					
				
					 2 changed files with 4 additions and 4 deletions
				
			
		|  | @ -73,7 +73,7 @@ void Reference::put_value(GlobalObject& global_object, Value value) | |||
|     } | ||||
| } | ||||
| 
 | ||||
| void Reference::throw_reference_error(GlobalObject& global_object) | ||||
| void Reference::throw_reference_error(GlobalObject& global_object) const | ||||
| { | ||||
|     auto& vm = global_object.vm(); | ||||
|     if (!m_name.is_valid()) | ||||
|  | @ -83,7 +83,7 @@ void Reference::throw_reference_error(GlobalObject& global_object) | |||
| } | ||||
| 
 | ||||
| // 6.2.4.5 GetValue ( V ), https://tc39.es/ecma262/#sec-getvalue
 | ||||
| Value Reference::get_value(GlobalObject& global_object, bool throw_if_undefined) | ||||
| Value Reference::get_value(GlobalObject& global_object, bool throw_if_undefined) const | ||||
| { | ||||
|     if (is_unresolvable()) { | ||||
|         throw_reference_error(global_object); | ||||
|  |  | |||
|  | @ -98,13 +98,13 @@ public: | |||
|     } | ||||
| 
 | ||||
|     void put_value(GlobalObject&, Value); | ||||
|     Value get_value(GlobalObject&, bool throw_if_undefined = true); | ||||
|     Value get_value(GlobalObject&, bool throw_if_undefined = true) const; | ||||
|     bool delete_(GlobalObject&); | ||||
| 
 | ||||
|     String to_string() const; | ||||
| 
 | ||||
| private: | ||||
|     void throw_reference_error(GlobalObject&); | ||||
|     void throw_reference_error(GlobalObject&) const; | ||||
| 
 | ||||
|     BaseType m_base_type { BaseType::Unresolvable }; | ||||
|     union { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ali Mohammad Pur
						Ali Mohammad Pur