1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00
serenity/Libraries/LibJS
Andreas Kling 1d468ed6d3 AK: Stop allowing implicit downcast with RefPtr and NonnullRefPtr
We were allowing this dangerous kind of thing:

RefPtr<Base> base;
RefPtr<Derived> derived = base;

This patch changes the {Nonnull,}RefPtr constructors so this is no
longer possible.

To downcast one of these pointers, there is now static_ptr_cast<T>:

RefPtr<Derived> derived = static_ptr_cast<Derived>(base);

Fixing this exposed a ton of cowboy-downcasts in various places,
which we're now forced to fix. :^)
2020-04-05 11:19:00 +02:00
..
Heap LibJS: Disable HEAP_DEBUG logging on non-SerenityOS platforms 2020-03-25 09:49:14 +01:00
Runtime AK: Stop allowing implicit downcast with RefPtr and NonnullRefPtr 2020-04-05 11:19:00 +02:00
Tests LibJS: Fix missing paren in modulo-basic.js test 2020-04-05 11:19:00 +02:00
AST.cpp LibJS: Clean up the anonymous wrapper block in "for" using ScopeGuard 2020-04-05 00:24:32 +02:00
AST.h AK: Stop allowing implicit downcast with RefPtr and NonnullRefPtr 2020-04-05 11:19:00 +02:00
Forward.h LibJS: Correctly forward declare "Argument" as a struct 2020-04-04 10:46:00 +02:00
Interpreter.cpp LibJS: Don't return the "last computed value" from Interpreter::run() 2020-04-04 23:45:13 +02:00
Interpreter.h LibJS: Add support for "continue" inside "for" statements :^) 2020-04-05 00:22:42 +02:00
Lexer.cpp LibJS: Add support for "continue" inside "for" statements :^) 2020-04-05 00:22:42 +02:00
Lexer.h LibJS: Lex single quote strings, escaped chars and unterminated strings 2020-03-14 12:13:53 +01:00
Makefile LibJS: Add NumberObject and make to_object() on number values create it 2020-04-04 23:13:13 +02:00
Parser.cpp LibJS: Add support for "continue" inside "for" statements :^) 2020-04-05 00:22:42 +02:00
Parser.h LibJS: Add support for "continue" inside "for" statements :^) 2020-04-05 00:22:42 +02:00
Token.cpp LibJS: Hack the lexer to allow numbers with decimals 2020-04-04 23:13:48 +02:00
Token.h LibJS: Add support for "continue" inside "for" statements :^) 2020-04-05 00:22:42 +02:00