summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Error.h
AgeCommit message (Collapse)Author
2021-10-03LibJS: Convert install_error_cause() to ThrowCompletionOrLinus Groh
2021-06-26LibJS: Move install_error_cause() from Object to ErrorLinus Groh
This is only used by Error and its subclasses, so it doesn't need to be available to all objects.
2021-06-11LibJS: Implement the Error Cause proposalLinus Groh
Currently stage 3. https://github.com/tc39/proposal-error-cause
2021-06-11LibJS: Rename JS_ENUMERATE_{ERROR_SUBCLASSES => NATIVE_ERRORS}Linus Groh
The fact that they *are* subclasses is an implementation detail and should not be highlighted. The spec calls these NativeErrors, so let's use that. Also added a comment explaining *why* they inherit from Error - I was about to change that :^)
2021-04-22Everywhere: Use linusg@serenityos.org for my copyright headersLinus Groh
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-12LibJS: Make Errors fully spec compliantLinus Groh
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-01-12Libraries: Move to Userland/Libraries/Andreas Kling