1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00
serenity/Userland/Libraries/LibJS
Daniel Bertalan d7b6cc6421 Everywhere: Prevent risky implicit casts of (Nonnull)RefPtr
Our existing implementation did not check the element type of the other
pointer in the constructors and move assignment operators. This meant
that some operations that would require explicit casting on raw pointers
were done implicitly, such as:
- downcasting a base class to a derived class (e.g. `Kernel::Inode` =>
  `Kernel::ProcFSDirectoryInode` in Kernel/ProcFS.cpp),
- casting to an unrelated type (e.g. `Promise<bool>` => `Promise<Empty>`
  in LibIMAP/Client.cpp)

This, of course, allows gross violations of the type system, and makes
the need to type-check less obvious before downcasting. Luckily, while
adding the `static_ptr_cast`s, only two truly incorrect usages were
found; in the other instances, our casts just needed to be made
explicit.
2021-09-03 23:20:23 +02:00
..
Bytecode LibJS: Change ExecutionContext's arguments list to a MarkedValueList 2021-08-10 23:07:50 +02:00
Heap LibJS: Avoid pointless transitions and metadata lookups in storage_set() 2021-08-28 23:17:01 +01:00
Runtime LibJS: Account for negative numbers in ToTemporalDurationRecord 2021-09-02 20:16:44 +01:00
Tests LibJS: Throw RangeError for non-integral values in ToPartialDuration 2021-09-02 20:16:44 +01:00
AST.cpp LibJS: Add support for public fields in classes 2021-09-01 13:39:14 +01:00
AST.h LibJS: Add support for public fields in classes 2021-09-01 13:39:14 +01:00
CMakeLists.txt LibJS: Implement a nearly empty Intl.Locale object 2021-09-02 17:56:42 +01:00
Console.cpp LibJS: Rename CallFrame => ExecutionContext 2021-06-24 19:28:00 +02:00
Console.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Forward.h LibJS: Implement a nearly empty Intl.Locale object 2021-09-02 17:56:42 +01:00
Interpreter.cpp LibJS: Change ExecutionContext's arguments list to a MarkedValueList 2021-08-10 23:07:50 +02:00
Interpreter.h LibJS: Drop "Record" suffix from all the *Environment record classes 2021-07-01 12:28:57 +02:00
Lexer.cpp LibJS: Fix incorrect Lexer VERIFY when parsing Unicode characters 2021-08-25 09:21:23 +01:00
Lexer.h LibJS: Fix some small remaining issues with parsing unicode escapes 2021-08-24 07:42:37 +01:00
MarkupGenerator.cpp LibJS: Remove unused includes out of Cell.h, move to the users 2021-08-01 08:10:16 +02:00
MarkupGenerator.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Parser.cpp Everywhere: Prevent risky implicit casts of (Nonnull)RefPtr 2021-09-03 23:20:23 +02:00
Parser.h Everywhere: Prevent risky implicit casts of (Nonnull)RefPtr 2021-09-03 23:20:23 +02:00
SourceRange.h LibJS: Implement parsing and evaluation for AssignmentPatterns 2021-07-11 21:41:54 +01:00
SyntaxHighlighter.cpp LibJS: Remove unused header includes 2021-08-01 08:10:16 +02:00
SyntaxHighlighter.h LibWeb+LibSyntax: Implement nested syntax highlighters 2021-06-07 14:45:49 +04:30
Token.cpp LibJS: Fix some small remaining issues with parsing unicode escapes 2021-08-24 07:42:37 +01:00
Token.h LibJS: Disallow yield expression correctly in formal parameters 2021-08-24 07:42:37 +01:00