1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2026-01-20 19:30:59 +00:00
serenity/Applications/Spreadsheet
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
..
CellSyntaxHighlighter.cpp Spreadsheet: Add a syntax highlighter to the cell editor 2020-08-24 19:15:07 +02:00
CellSyntaxHighlighter.h Spreadsheet: Add a syntax highlighter to the cell editor 2020-08-24 19:15:07 +02:00
CMakeLists.txt Spreadsheet: Add a syntax highlighter to the cell editor 2020-08-24 19:15:07 +02:00
HelpWindow.cpp LibWeb: Move OutOfProcessWebView into the Web namespace 2020-08-24 18:21:33 +02:00
HelpWindow.h LibWeb: Move OutOfProcessWebView into the Web namespace 2020-08-24 18:21:33 +02:00
main.cpp Spreadsheet: Add "Save As" 2020-08-25 09:46:28 +02:00
Spreadsheet.cpp LibJS: Make Interpreter::throw_exception() a void function 2020-08-25 18:30:31 +02:00
Spreadsheet.h Spreadsheet: Implement state-preserving saves and loads 2020-08-25 09:46:28 +02:00
SpreadsheetModel.cpp Spreadsheet: Start making a spreadsheet application 2020-08-24 18:21:33 +02:00
SpreadsheetModel.h Spreadsheet: Start making a spreadsheet application 2020-08-24 18:21:33 +02:00
SpreadsheetView.cpp Spreadsheet: Fix crash when a row number is selected 2020-08-24 19:15:07 +02:00
SpreadsheetView.h Spreadsheet: Add a topbar with a text editor 2020-08-24 18:21:33 +02:00
SpreadsheetWidget.cpp Spreadsheet: Add "Save As" 2020-08-25 09:46:28 +02:00
SpreadsheetWidget.h Spreadsheet: Add "Save As" 2020-08-25 09:46:28 +02:00