mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 20:52:45 +00:00 
			
		
		
		
	LibWeb: Allow IDL interfaces to override get_by_index()
You can now specify the "CustomGetByIndex" extended interface attribute which will cause the generator to emit an override declaration for JS::Object::get_by_index(). It's up to you to implement that function somewhere. Just like the CustomGet mechanism already works. :^)
This commit is contained in:
		
							parent
							
								
									dc0fc16981
								
							
						
					
					
						commit
						49f3d88baf
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		|  | @ -768,6 +768,11 @@ public: | ||||||
|     if (interface.extended_attributes.contains("CustomGet")) { |     if (interface.extended_attributes.contains("CustomGet")) { | ||||||
|         generator.append(R"~~~( |         generator.append(R"~~~( | ||||||
|     virtual JS::Value get(const JS::PropertyName&, JS::Value receiver = {}, bool without_side_effects = false) const override; |     virtual JS::Value get(const JS::PropertyName&, JS::Value receiver = {}, bool without_side_effects = false) const override; | ||||||
|  | )~~~"); | ||||||
|  |     } | ||||||
|  |     if (interface.extended_attributes.contains("CustomGetByIndex")) { | ||||||
|  |         generator.append(R"~~~( | ||||||
|  |     virtual JS::Value get_by_index(u32 property_index) const override; | ||||||
| )~~~"); | )~~~"); | ||||||
|     } |     } | ||||||
|     if (interface.extended_attributes.contains("CustomPut")) { |     if (interface.extended_attributes.contains("CustomPut")) { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling