serenity/Userland
Matthew Olsson dd08c992e8 LibJS: Simplify and normalize publicly-exposed Object functions
Previously, the Object class had many different types of functions for
each action. For example: get_by_index, get(PropertyName),
get(FlyString). This is a bit verbose, so these methods have been
shortened to simply use the PropertyName structure. The methods then
internally call _by_index if necessary. Note that the _by_index
have been made private to enforce this change.

Secondly, a clear distinction has been made between "putting" and
"defining" an object property. "Putting" should mean modifying a
(potentially) already existing property. This is akin to doing "a.b =
'foo'".

This implies two things about put operations:
    - They will search the prototype chain for setters and call them, if
      necessary.
    - If no property exists with a particular key, the put operation
      should create a new property with the default attributes
      (configurable, writable, and enumerable).

In contrast, "defining" a property should completely overwrite any
existing value without calling setters (if that property is
configurable, of course).

Thus, all of the many JS objects have had any "put" calls changed to
"define_property" calls. Additionally, "put_native_function" and
"put_native_property" have had their "put" replaced with "define".

Finally, "put_own_property" has been made private, as all necessary
functionality should be exposed with the put and define_property
methods.
2020-05-27 13:17:35 +02:00
..
allocate.cpp Userspace: Add missing #includes now that AK/StdLibExtras.h is smaller 2020-03-08 13:06:51 +01:00
aplay.cpp LibAudio/aplay: Handle WAV header errors properly 2020-02-10 14:04:27 +01:00
arp.cpp Userland: Add arp utility (#1962) 2020-04-26 12:54:22 +02:00
avol.cpp LibGUI: Add forwarding header 2020-02-16 09:41:56 +01:00
basename.cpp AK: Rename FileSystemPath -> LexicalPath 2020-05-26 14:35:10 +02:00
cal.cpp LibCore: Moved cal.cpp functions to DateTime 2020-03-18 08:17:01 +01:00
cat.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
chgrp.cpp Userland: Fix null-pointer deref on unknown user/group in chown/chgrp 2020-04-04 19:29:30 +02:00
chmod.cpp chmod: Tweak usage string 2020-02-16 09:51:49 +01:00
chown.cpp Userland: Fix null-pointer deref on unknown user/group in chown/chgrp 2020-04-04 19:29:30 +02:00
chroot.cpp LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
clear.cpp clear: Use pledge() 2020-02-18 11:35:47 +01:00
CMakeLists.txt LibWeb: Begin work on a spec-compliant HTML parser 2020-05-22 21:46:13 +02:00
copy.cpp FileManager+LibGUI+Userland: Switch clipboard to MIME types 2020-05-16 09:11:46 +02:00
cp.cpp AK: Rename FileSystemPath -> LexicalPath 2020-05-26 14:35:10 +02:00
crash.cpp Kernel: Absorb LibBareMetal back into the kernel 2020-05-16 12:00:04 +02:00
cut.cpp Userland: Correction in the the copyright 2020-03-11 10:12:36 +01:00
date.cpp Userland: Remove double-'#include' in date.cpp 2020-05-09 10:00:29 +02:00
df.cpp df: Don't include c++ standard <cstring> 2020-05-20 08:37:50 +02:00
disasm.cpp Userland: Add missing copyright header to disasm.cpp 2020-05-09 23:45:16 +02:00
disk_benchmark.cpp Userspace: Add missing #includes now that AK/StdLibExtras.h is smaller 2020-03-08 13:06:51 +01:00
dmesg.cpp AK: Use size_t for ByteBuffer sizes 2020-02-20 13:20:34 +01:00
du.cpp AK: Rename FileSystemPath -> LexicalPath 2020-05-26 14:35:10 +02:00
echo.cpp echo: Use pledge() 2020-02-18 11:35:47 +01:00
env.cpp env: Use pledge() 2020-02-18 13:29:54 +01:00
false.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
fgrep.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
flock.cpp Meta: Add missing copyright headers 2020-04-06 11:09:01 +02:00
functrace.cpp Userland et al: Pledge sigaction when needed 2020-05-26 14:35:10 +02:00
gron.cpp AK: Make Vector use size_t for its size and capacity 2020-02-25 14:52:35 +01:00
head.cpp Userspace: Add missing #includes now that AK/StdLibExtras.h is smaller 2020-03-08 13:06:51 +01:00
host.cpp host: Use ArgsParser to parse arguments, and add man page (#1252) 2020-02-20 15:12:55 +01:00
hostname.cpp Kernel: Added the ability to set the hostname via new syscall 2020-04-26 12:59:09 +02:00
ht.cpp LibWeb: A whole bunch of work towards spec-compliant <script> elements 2020-05-24 23:54:22 +02:00
html.cpp LibGUI: Make MenuBar a Core::Object 2020-04-21 16:19:18 +02:00
id.cpp LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
ifconfig.cpp Userland: ifconfig can change the IP address of the default gateway 2020-03-15 19:09:31 +01:00
jp.cpp jp: Use pledge() 2020-02-11 12:16:07 +01:00
js.cpp LibJS: Simplify and normalize publicly-exposed Object functions 2020-05-27 13:17:35 +02:00
keymap.cpp keymap: Fix crash introduced by 637ecdb 2020-05-05 00:12:51 +02:00
kill.cpp Userland: Fix kill to support negative pid values. 2020-04-26 12:54:10 +02:00
killall.cpp LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
ln.cpp ln: Use pledge() 2020-02-18 13:29:54 +01:00
ls.cpp Kernel+LibC: Fix various build issues introduced by ssize_t 2020-05-23 15:27:33 +02:00
lsirq.cpp Userland: Replace lsinterrupts with lsirq 2020-03-06 11:19:51 +01:00
lspci.cpp Userland: Fix nullptr dereference if we fail to open the PCIDB 2020-02-20 15:13:42 +01:00
man.cpp LibMarkdown: Drop MD prefixes and move into "Markdown" namespace :^) 2020-04-28 21:04:25 +02:00
md.cpp LibMarkdown: Drop MD prefixes and move into "Markdown" namespace :^) 2020-04-28 21:04:25 +02:00
mkdir.cpp AK: Rename FileSystemPath -> LexicalPath 2020-05-26 14:35:10 +02:00
mknod.cpp mknod: Use pledge() 2020-01-27 21:38:36 +01:00
modload.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
modunload.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
more.cpp more: Read keystrokes from stdout instead of trying to re-open it 2020-02-08 15:50:00 +01:00
mount.cpp Misc: Replace "String(string_view)" with "string_view.to_string()" 2020-05-06 19:28:59 +02:00
mv.cpp AK: Rename FileSystemPath -> LexicalPath 2020-05-26 14:35:10 +02:00
nc.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
nl.cpp LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
notify.cpp LibGfx+LibIPC: Add Gfx::ShareableBitmap, a bitmap for easy IPC usage 2020-03-29 19:37:23 +02:00
open.cpp open: Create a Core::EventLoop before using Desktop::Launcher 2020-05-14 20:22:20 +02:00
pape.cpp AK: Rename FileSystemPath -> LexicalPath 2020-05-26 14:35:10 +02:00
paste.cpp FileManager+LibGUI+Userland: Switch clipboard to MIME types 2020-05-16 09:11:46 +02:00
pidof.cpp Userspace: Add missing #includes now that AK/StdLibExtras.h is smaller 2020-03-08 13:06:51 +01:00
ping.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
pro.cpp ProtocolServer: Pass HTTP response headers to the client 2020-05-03 23:01:58 +02:00
profile.cpp profile: Allow launching a command with profiling enabled 2020-02-22 11:01:37 +01:00
ps.cpp ps: Widen the username column slightly 2020-05-15 00:01:01 +02:00
purge.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
realpath.cpp realpath: Use pledge() 2020-02-18 13:29:54 +01:00
reboot.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
rm.cpp rm: Allow specifying multiple paths to remove 2020-03-01 12:11:31 +01:00
rmdir.cpp rmdir: Use pledge() 2020-02-18 11:35:47 +01:00
shutdown.cpp LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
sleep.cpp Userland et al: Pledge sigaction when needed 2020-05-26 14:35:10 +02:00
sort.cpp Userspace: Add missing #includes now that AK/StdLibExtras.h is smaller 2020-03-08 13:06:51 +01:00
stat.cpp Kernel+LibC: Fix various build issues introduced by ssize_t 2020-05-23 15:27:33 +02:00
strace.cpp Revert "Build: Include headers from LibC, LibM, and LibPthread with -isystem" 2020-05-20 16:24:26 +02:00
su.cpp Userspace: Add missing #includes now that AK/StdLibExtras.h is smaller 2020-03-08 13:06:51 +01:00
sync.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
syscall.cpp AK: Add global FlatPtr typedef. It's u32 or u64, based on sizeof(void*) 2020-03-08 13:06:51 +01:00
sysctl.cpp sysctl: Permit 'sysctl -a' invocation 2020-05-04 09:41:43 +02:00
tail.cpp LibCore: Remove all remaining C prefix references 2020-03-07 01:33:53 +01:00
tee.cpp AK: Make Vector use size_t for its size and capacity 2020-02-25 14:52:35 +01:00
test-bindtodevice.cpp Meta: Add missing copyright headers 2020-04-06 11:09:01 +02:00
test-crypto.cpp test-crypto: Tweaks to make this build properly in Lagom 2020-05-27 12:39:58 +02:00
test_efault.cpp Kernel: Fail with EFAULT for any address+size that would wrap around 2020-01-29 12:56:07 +01:00
test_io.cpp Kernel: rmdir("/") should fail instead of asserting 2020-04-19 18:07:16 +02:00
top.cpp AK: Make quick_sort() a little more ergonomic 2020-03-03 16:02:58 +01:00
touch.cpp Userland: "touch" can now handle multiple paths as arguments 2020-05-01 17:08:46 +02:00
tr.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
true.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
truncate.cpp Userland: Delete redundant code in truncate 2020-02-23 06:46:38 +01:00
tt.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
tty.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
umount.cpp LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
uname.cpp uname: Remove trailing space character 2020-03-25 15:48:35 +01:00
unzip.cpp Userland: Add unzip command 2020-05-09 23:50:44 +02:00
uptime.cpp uptime: Use pledge() 2020-02-18 13:29:54 +01:00
useradd.cpp LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
userdel.cpp Meta: Adjust some copyright dates by Fei Wu 2020-03-02 14:24:25 +01:00
wc.cpp wc: Use pledge() 2020-02-18 11:35:47 +01:00
which.cpp which: Use pledge() 2020-02-18 11:35:47 +01:00
whoami.cpp whoami: Use pledge() and unveil() 2020-02-18 11:35:47 +01:00
yes.cpp yes: Use pledge() 2020-02-18 11:35:47 +01:00