1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2026-01-12 23:01:01 +00:00
serenity/Userland
Linus Groh 433a23cfde LibJS: Fix array hole and string object indexing prototype indirection
This fixes two cases of indexed access (array holes, out-of-bounds
string object access) where we would not follow the prototype chain and
incorrectly return undefined:

    // Should be "a", returned undefined
    Object.setPrototypeOf([,], ["a"])[0]

    // Should be "a", returned undefined
    Object.setPrototypeOf(new String(""), new String("a"))[0]

The actual fix is simple, instead of returning early if the requested
index is past the string's length or within the indexed properties size
but has no value, we just continue the prototype chain traversal and get
correct behaviour from that.
2021-04-11 18:15:47 +02:00
..
Applets FontEditor+ClipboardHistory: Use system-wide Clipboard 2021-04-07 19:27:01 +02:00
Applications SystemMonitor: Add tab with detailed state to process properties window 2021-04-11 13:24:59 +02:00
Demos Everywhere: Change font properties to be described in GML 2021-03-29 09:10:23 +02:00
DevTools Playground: Add Alt shortcuts to menus 2021-04-11 10:38:45 +02:00
DynamicLoader LibC: Add x86_64 Registers 2021-03-21 09:35:23 +01:00
Games Minesweeper: Fix UI layout and focus behavior 2021-04-06 17:55:47 +02:00
Libraries LibJS: Fix array hole and string object indexing prototype indirection 2021-04-11 18:15:47 +02:00
Services LibWeb+WebContent: Support image context menus in OOPWV 2021-04-11 16:49:25 +02:00
Shell Shell: Allow newlines between the function decl and its body 2021-04-08 10:46:39 +02:00
Tests Tests: Merge duplicate TestFormat test into AK directory 2021-04-08 20:30:56 +02:00
Utilities LibC: Move S_* defines into <fcntl.h> 2021-04-11 09:51:20 +02:00
CMakeLists.txt Userland: Rename *.MenuApplet => *.Applet 2021-04-04 16:29:55 +02:00