1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:18:11 +00:00
serenity/Libraries/LibJS
Linus Groh ad8abce8a5 LibJS: Let Array.prototype.map() resize new array before loop
Currently we would create an empty array of size 0 and appening results
of the callback function while skipping empty values.

This is incorrect, we should be initializing a full array of the correct
size beforehand and then inserting the results while still skipping
empty values.

Wrong: new Array(5).map(() => {}) // []
Right: new Array(5).map(() => {}) // [<empty> * 5]
2020-04-28 20:15:38 +02:00
..
Heap LibJS: Add MarkedValueList and use it for argument passing 2020-04-19 17:34:33 +02:00
Runtime LibJS: Let Array.prototype.map() resize new array before loop 2020-04-28 20:15:38 +02:00
Tests LibJS: Let Array.prototype.map() resize new array before loop 2020-04-28 20:15:38 +02:00
AST.cpp LibJS: Support spreading of strings and string objects 2020-04-28 15:35:24 +02:00
AST.h LibJS: Make AssignmentExpression assign through a Reference 2020-04-28 15:07:08 +02:00
Forward.h LibJS: Add Reference class to represent a base.property reference 2020-04-28 15:07:08 +02:00
Interpreter.cpp LibJS: Support o.f++ :^) 2020-04-28 15:07:08 +02:00
Interpreter.h LibJS: Allow "delete someGlobalVariable" 2020-04-28 15:07:08 +02:00
Lexer.cpp LibJS: Add spreading in array literals 2020-04-27 11:32:18 +02:00
Lexer.h LibJS: Handle HTML-style comments 2020-04-14 12:54:09 +02:00
Makefile LibJS: Make AssignmentExpression assign through a Reference 2020-04-28 15:07:08 +02:00
Parser.cpp LibJS: Add spreading in array literals 2020-04-27 11:32:18 +02:00
Parser.h LibJS: Parse while statements 2020-04-22 11:48:14 +02:00
Token.cpp LibJS: Add TokenType::TemplateLiteral 2020-04-24 11:18:57 +02:00
Token.h LibJS: Add spreading in array literals 2020-04-27 11:32:18 +02:00