mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 08:47:35 +00:00
![]() This patch is unfortunately rather large and might make some things feel bloated, but it is necessary to fix a few flaws in LibJS, primarily blindly coercing values to numbers without exception checks - i.e. interpreter.argument(0).to_i32(); // can fail!!! Some examples where the interpreter would actually crash: var o = { toString: () => { throw Error() } }; +o; o - 1; "foo".charAt(o); "bar".repeat(o); To fix this, we now have the following... to_double(Interpreter&) to_i32() to_i32(Interpreter&) to_size_t() to_size_t(Interpreter&) ...and a whole lot of exception checking. There's intentionally no to_double(), use as_double() directly instead. This way we still can use these convenient utility functions but don't need to check for exceptions if we are sure the value already is a number. Fixes #2267. |
||
---|---|---|
.. | ||
Bindings | ||
CodeGenerators | ||
CSS | ||
DOM | ||
Layout | ||
Parser | ||
Scripts | ||
CMakeLists.txt | ||
DOMTreeModel.cpp | ||
DOMTreeModel.h | ||
Dump.cpp | ||
Dump.h | ||
FontCache.cpp | ||
FontCache.h | ||
Forward.h | ||
Frame.cpp | ||
Frame.h | ||
HtmlView.cpp | ||
HtmlView.h | ||
Origin.h | ||
RenderingContext.h | ||
ResourceLoader.cpp | ||
ResourceLoader.h | ||
StylePropertiesModel.cpp | ||
StylePropertiesModel.h | ||
TreeNode.h | ||
URLEncoder.cpp | ||
URLEncoder.h |