1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2026-01-20 17:30:59 +00:00
serenity/Applications
Linus Groh 9ea6ef4ed1 LibJS: Make Interpreter::throw_exception() a void function
The motivation for this change is twofold:

- Returning a JS::Value is misleading as one would expect it to carry
  some meaningful information, like maybe the error object that's being
  created, but in fact it is always empty. Supposedly to serve as a
  shortcut for the common case of "throw and return empty value", but
  that's just leading us to my second point.
- Inconsistent usage / coding style: as of this commit there are 114
  uses of throw_exception() discarding its return value and 55 uses
  directly returning the call result (in LibJS, not counting LibWeb);
  with the first style often having a more explicit empty value (or
  nullptr in some cases) return anyway.
  One more line to always make the return value obvious is should be
  worth it.

So now it's basically always these steps, which is already being used in
the majority of cases (as outlined above):

- Throw an exception. This mutates interpreter state by updating
  m_exception and unwinding, but doesn't return anything.
- Let the caller explicitly return an empty value, nullptr or anything
  else itself.
2020-08-25 18:30:31 +02:00
..
About LibGUI: Make GUI::Application a Core::Object 2020-07-04 14:05:57 +02:00
Browser LibWeb: Move OutOfProcessWebView into the Web namespace 2020-08-24 18:21:33 +02:00
Calculator Applications: Stop setting initial window location 2020-08-01 08:06:48 +02:00
Calendar LibGUI+Calendar: Make Calendar a common widget in LibGUI 2020-08-22 11:54:30 +02:00
ChessEngine ChessEngine: Add ChessEngine 2020-08-21 12:26:30 +02:00
Debugger LibDebug: Move everything into the "Debug" namespace 2020-08-25 09:46:06 +02:00
DisplaySettings LibGUI: Move GUI::Model::Role to GUI::ModelRole 2020-08-16 16:44:09 +02:00
FileManager FileManager: Make DirectoryView vend indexes from view model 2020-08-17 22:49:52 +02:00
FontEditor Applications: Stop setting initial window location 2020-08-01 08:06:48 +02:00
Help LibWeb: Rename PageView => InProcessWebView 2020-08-17 18:05:35 +02:00
HexEditor Applications: Stop setting initial window location 2020-08-01 08:06:48 +02:00
IRCClient LibWeb: Rename PageView => InProcessWebView 2020-08-17 18:05:35 +02:00
KeyboardMapper Unicode: Try s/codepoint/code_point/g again 2020-08-05 22:33:42 +02:00
KeyboardSettings LibGUI: Move GUI::Model::Role to GUI::ModelRole 2020-08-16 16:44:09 +02:00
Piano Piano: Uninitialized member variables in RollWidet, found by Coverity 2020-08-17 09:17:57 +02:00
PixelPaint Meta: Replace remaining LibM/math.h includes with math.h 2020-08-12 16:18:33 +02:00
QuickShow QuickShow: Disown child process after spawning 2020-08-04 18:17:16 +02:00
SoundPlayer SoundPlayer: Uninitialized variable in SoundPlayerWidget, found by Coverity 2020-08-17 09:17:57 +02:00
Spreadsheet LibJS: Make Interpreter::throw_exception() a void function 2020-08-25 18:30:31 +02:00
SystemMonitor SystemMonitor: Tweak processor feature display a little bit 2020-08-24 18:22:09 +02:00
Terminal Misc: Use automatic window positioning in more applications 2020-08-15 17:38:19 +02:00
TextEditor LibWeb: Rename PageView => InProcessWebView 2020-08-17 18:05:35 +02:00
ThemeEditor ThemeEditor: Paint the minimize/maximize/close window button icons 2020-08-23 15:02:44 +02:00
Welcome Base: Rename Pebbleton to reflect actual height 2020-08-16 19:38:21 +02:00
CMakeLists.txt Spreadsheet: Start making a spreadsheet application 2020-08-24 18:21:33 +02:00