1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 23:07:34 +00:00
serenity/Userland/Libraries/LibWeb/Bindings
Linus Groh da177c6517 LibJS: Make Errors fully spec compliant
The previous handling of the name and message properties specifically
was breaking websites that created their own error types and relied on
the error prototype working correctly - not assuming an JS::Error this
object, that is.

The way it works now, and it is supposed to work, is:

- Error.prototype.name and Error.prototype.message just have initial
  string values and are no longer getters/setters
- When constructing an error with a message, we create a regular
  property on the newly created object, so a lookup of the message
  property will either get it from the object directly or go though the
  prototype chain
- Internal m_name/m_message properties are no longer needed and removed

This makes printing errors slightly more complicated, as we can no
longer rely on the (safe) internal properties, and cannot trust a
property lookup either - get_without_side_effects() is used to solve
this, it's not perfect but something we can revisit later.

I did some refactoring along the way, there was some really old stuff in
there - accessing vm.call_frame().arguments[0] is not something we (have
to) do anymore :^)

Fixes #6245.
2021-04-12 09:38:57 +02:00
..
CSSStyleDeclarationWrapperCustom.cpp LibJS: Make Errors fully spec compliant 2021-04-12 09:38:57 +02:00
EventListenerWrapper.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
EventListenerWrapper.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
EventTargetWrapperFactory.cpp LibWeb: Make the Window object "inherit" from EventTarget :^) 2021-01-18 12:18:29 +01:00
EventTargetWrapperFactory.h LibWeb: Make the Window object "inherit" from EventTarget :^) 2021-01-18 12:18:29 +01:00
EventWrapperFactory.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
EventWrapperFactory.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
ExceptionOrUtils.h AK+Everywhere: Make StdLibExtras templates less wrapper-y 2021-04-10 21:01:31 +02:00
ImageConstructor.cpp LibWeb: Add legacy Image factory function 2021-03-21 09:37:25 +01:00
ImageConstructor.h LibWeb: Add legacy Image factory function 2021-03-21 09:37:25 +01:00
LocationObject.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LocationObject.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
MainThreadVM.cpp LibWeb: Move main thread JavaScript VM to its own file 2021-02-03 10:45:39 +01:00
MainThreadVM.h LibWeb: Move main thread JavaScript VM to its own file 2021-02-03 10:45:39 +01:00
NavigatorObject.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
NavigatorObject.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
NodeWrapperFactory.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
NodeWrapperFactory.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
ScriptExecutionContext.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
ScriptExecutionContext.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
WindowObject.cpp LibWeb: Add Window.parent and fix Window.top attributes 2021-04-12 09:01:08 +02:00
WindowObject.h LibWeb: Add Window.parent and fix Window.top attributes 2021-04-12 09:01:08 +02:00
WindowObjectHelper.h LibWeb: Add ProcessingInstruction node 2021-04-06 21:42:00 +02:00
Wrappable.cpp Everywhere: Rename ASSERT => VERIFY 2021-02-23 20:56:54 +01:00
Wrappable.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Wrapper.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00