1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2026-01-13 22:20:59 +00:00
serenity/Libraries/LibWeb
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
..
Bindings LibJS: Make Interpreter::throw_exception() a void function 2020-08-25 18:30:31 +02:00
CodeGenerators LibJS: Make Interpreter::throw_exception() a void function 2020-08-25 18:30:31 +02:00
CSS LibWeb: Add Comment and DocumentFragment bindings, move querySelector... 2020-08-17 22:57:05 +02:00
DOM LibWeb: Implement <template> parsing 2020-08-21 11:57:11 +02:00
HTML Misc: Remove some unneeded includes of Timer.h and ElapsedTimer.h (#3286) 2020-08-25 09:41:56 +02:00
Layout LibWeb: Make selection state recomputation implicit 2020-08-21 17:57:24 +02:00
Loader LibWeb: Mark compilation-unit-only functions as static 2020-08-12 20:40:59 +02:00
Page LibWeb: Make selection state recomputation implicit 2020-08-21 17:57:24 +02:00
Painting LibWeb: Only paint focus outline when browser window has focus 2020-08-15 00:05:45 +02:00
Scripts LibWeb: Move CSS classes into the Web::CSS namespace 2020-07-26 20:05:15 +02:00
SVG LibWeb: Crash instead of spinning if parse_drawto fails to match 2020-08-20 16:31:13 +02:00
Tests LibWeb: Implement <template> parsing 2020-08-21 11:57:11 +02:00
UIEvents LibWeb: Oops, provide the correct WrapperType for UIEvent 2020-07-28 19:40:11 +02:00
CMakeLists.txt LibWeb: Add more document tests, add comment, text and mixin tests 2020-08-17 22:57:05 +02:00
DOMTreeModel.cpp LibWeb: Implement <template> parsing 2020-08-21 11:57:11 +02:00
DOMTreeModel.h LibGUI: Move GUI::Model::Role to GUI::ModelRole 2020-08-16 16:44:09 +02:00
Dump.cpp LibWeb: Implement <template> parsing 2020-08-21 11:57:11 +02:00
Dump.h LibWeb: Move CSS classes into the Web::CSS namespace 2020-07-26 20:05:15 +02:00
FontCache.cpp LibWeb: Rename directory LibHTML => LibWeb 2020-03-07 10:32:51 +01:00
FontCache.h LibWeb: Use FlyString in FontCache keys 2020-05-26 23:45:48 +02:00
Forward.h LibWeb: Implement <template> parsing 2020-08-21 11:57:11 +02:00
InProcessWebView.cpp LibWeb: InProcessWebView::selected_text() should use the focused frame 2020-08-21 18:58:21 +02:00
InProcessWebView.h LibWeb: Rename PageView => InProcessWebView 2020-08-17 18:05:35 +02:00
LayoutTreeModel.cpp LibGUI: Move GUI::Model::Role to GUI::ModelRole 2020-08-16 16:44:09 +02:00
LayoutTreeModel.h LibGUI: Move GUI::Model::Role to GUI::ModelRole 2020-08-16 16:44:09 +02:00
Origin.h LibWeb: Add Origin concept (protocol, host, port tuple) 2020-04-07 23:01:45 +02:00
OutOfProcessWebView.cpp LibWeb: Move OutOfProcessWebView into the Web namespace 2020-08-24 18:21:33 +02:00
OutOfProcessWebView.h LibWeb: Move OutOfProcessWebView into the Web namespace 2020-08-24 18:21:33 +02:00
StylePropertiesModel.cpp LibGUI: Move GUI::Model::Role to GUI::ModelRole 2020-08-16 16:44:09 +02:00
StylePropertiesModel.h LibGUI: Move GUI::Model::Role to GUI::ModelRole 2020-08-16 16:44:09 +02:00
TreeNode.h LibWeb: Move tree iteration helpers from Node/LayoutNode to TreeNode 2020-08-10 15:21:23 +02:00
URLEncoder.cpp LibWeb: Use the URL encoder from AK instead of rolling a custom one 2020-06-15 17:56:00 +02:00
URLEncoder.h LibWeb: Use the URL encoder from AK instead of rolling a custom one 2020-06-15 17:56:00 +02:00
WebContentClient.cpp LibWeb: Move OutOfProcessWebView into the Web namespace 2020-08-24 18:21:33 +02:00
WebContentClient.h LibWeb: Move OutOfProcessWebView into the Web namespace 2020-08-24 18:21:33 +02:00
WebViewHooks.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00