mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:12:43 +00:00 
			
		
		
		
	LibJS: Bring ArrayCreate and ArrayConstructor closer to spec
Specifically, this now explicitly takes the length, adds missing exceptions checks to calls with user-supplied lengths, takes and uses the prototype argument, and fixes some spec non-conformance in ArrayConstructor and its native functions around the use of ArrayCreate
This commit is contained in:
		
							parent
							
								
									5ee1ae37b2
								
							
						
					
					
						commit
						e480d69130
					
				
					 17 changed files with 172 additions and 96 deletions
				
			
		|  | @ -1401,7 +1401,7 @@ static @fully_qualified_name@* impl_from(JS::VM& vm, JS::GlobalObject& global_ob | |||
|             // FIXME: Remove this fake type hack once it's no longer needed.
 | ||||
|             //        Basically once we have NodeList we can throw this out.
 | ||||
|             scoped_generator.append(R"~~~( | ||||
|     auto* new_array = JS::Array::create(global_object); | ||||
|     auto* new_array = JS::Array::create(global_object, 0); | ||||
|     for (auto& element : retval) | ||||
|         new_array->indexed_properties().append(wrap(global_object, element)); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Idan Horowitz
						Idan Horowitz