summaryrefslogtreecommitdiff
path: root/Libraries
AgeCommit message (Collapse)Author
2020-04-07LibJS: Return false for NaN numbers in Value::to_boolean()Jack Karamanian
2020-04-06LibJS: Fix impossible member access for negative integersDexesTTP
The PropertyName class able to match a number or an array can only accept positive numerical values. However, the computed_property_name method sometimes returned negative values. This commit also adds a basic object access test case.
2020-04-06LibJS: Add String.prototype.toLowerCase()Andreas Kling
2020-04-06LibM: Improve pow() and powf()Linus Groh
2020-04-06LibJS: Inline JS::Value()Andreas Kling
I had this out of line for debugging reasons. Put it back inline.
2020-04-06LibJS: Support array holes, encoded as empty JS::ValueAndreas Kling
This patch adds a new kind of JS::Value, the empty value. It's what you get when you do JSValue() (or most commonly, {} in C++.) An empty Value signifies the absence of a value, and should never be visible to JavaScript itself. As of right now, it's used for array holes and as a return value when an exception has been thrown and we just want to unwind. This patch is a bit of a mess as I had to fix a whole bunch of code that was relying on JSValue() being undefined, etc.
2020-04-06LibJS: Give argument vectors an inline capacity of 8Andreas Kling
This avoids one malloc/free pair for every function call if there are 8 arguments or fewer.
2020-04-06LibJS: Add a PropertyName class that represents a string or a numberAndreas Kling
Now that we have two separate storages for Object properties depending on what kind of index they have, it's nice to have an abstraction that still allows us to say "here's a property name". We use PropertyName to always choose the optimal storage path directly while interpreting the AST. :^)
2020-04-06LibJS: Add a number-indexed property storage to all ObjectsAndreas Kling
Objects can have both named and indexed properties. Previously we kept all property names as strings. This patch separates named and indexed properties and splits them between Object::m_storage and m_elements. This allows us to do much faster array-style access using numeric indices. It also makes the Array class much less special, since all Objects now have number-indexed storage. :^)
2020-04-06LibJS: Do a garbage collection every N allocations (N=10'000)Andreas Kling
To prevent the heap from growing infinitely large, we now do a full GC every 10'000 allocations. :^)
2020-04-06LibM: Fix ceil() and ceilf() for negative numbersLinus Groh
These functions are using a naive approach: casting double/float to int and returning the result + 1. That increment by one must only happen for positive input values though.
2020-04-06Kernel & Userland: Allow to mount image files formatted with Ext2FSLiav A
2020-04-06LibJS: Fix some tests for Math.min()Emanuele Torre
In some of the tests in Math.min.js, we were testing Math.max() instead of Math.min()
2020-04-06LibGUI: Added the new icons to FileSystemModel.VAN BOSSUYT Nicolas
2020-04-06LibJS: Rename variable "max" to "min" in MathObject::min() (#1665)Emanuele Torre
2020-04-06LibJS: Object needs to protect values in its storageAndreas Kling
Otherwise the garbage collector will eat them way too soon! This made it impossible to use "js -g" without crashing.
2020-04-06LibC: create a stub for getrusage.Xiao NuoFu
2020-04-06Meta: Add missing copyright headersAndreas Kling
2020-04-06LibJS: Add Math.{cos,sin,tan}()Linus Groh
2020-04-06LibJS: Simplify MathObject functionsLinus Groh
2020-04-06AK: Make dbgprintf() and dbgputstr() go to stderr on non-Serenity hostsAndreas Kling
2020-04-06AK: Add out() and warn() streams that forward to stdout and stderrAndreas Kling
Our C++ code generator tools have been relying on host-side dbg() being forwarded to stdout until now. Now they use out() instead. Hopefully this will make it easier and more enticing to use streams in userspace programs as well. :^)
2020-04-06LibGUI: Add remove_tab and on_change to TabWidgetOriko
2020-04-06LibJS: Remove unnecessary malloc+free in AssignmentExpression::executeAndreas Kling
We were creating a temporary AK::Function for no good reason, and this was dominating profiles. Reorganize the code so it's not necessary.
2020-04-06LibWeb: Allow window.setTimeout() with no intervalAndreas Kling
If no interval is specified, it will be treated as 0 and the callback function will be called on the next event loop iteration.
2020-04-06LibJS: Add Math.min()Andreas Kling
2020-04-05LibJS: Return -Infinity in Math.max() with no argumentLinus Groh
2020-04-05LibJS: Make Object::to_string() call the "toString" property if presentAndreas Kling
2020-04-05LibJS: Add Array.prototype.toString()Andreas Kling
2020-04-05LibJS: Fix do..while parsing by consuming parentheses explicitly (#1652)Maxim Brunnmeier
Before this patch the parser accepted conditions without enclosing parentheses (like: .."while number < 9").
2020-04-05LibJS: Report the start position of a token as its line columnAnotherTest
2020-04-05LibJS: Allow lexer to run without logging errorsAnotherTest
2020-04-05LibLine: Add live styling supportAnotherTest
This patchset adds an stylization interface to LibLine, and breaks multiline editing. With the most adorable Style constructor I've ever seen :^)
2020-04-05LibJS: Remove assert function from exponentiation-basic.jsLinus Groh
2020-04-05LibJS: Simplify Math-constants.js testLinus Groh
By borrowing an "expect close" function from LibM/TestMath.cpp, we can make this a lot simpler. Also the parser now understands decimals!
2020-04-05LibJS: Update to-number-basic.js testLinus Groh
Uncomment lines that are now parsing correctly :^)
2020-04-05LibJS: Fix Math.SQRT1_2Linus Groh
The value of Math.SQRT1_2 was zero as we were dividing two integers.
2020-04-05LibJS: Add numeric literal parsing for different bases and exponentsStephan Unverwerth
2020-04-05LibC: Fix strtod() parsing of negative exponents (#1645)Stephan Unverwerth
Before this fix negative exponents were interpreted as positive.
2020-04-05LibJS: Implement exponentiation (** operator)Linus Groh
2020-04-05LibJS: Rename BinaryOp::{Plus,Minus,Asterisk,Slash}Linus Groh
2020-04-05LibGfx: Implement checkerboard drawing for Gfx::PainterTibor Nagy
2020-04-05LibJS: Use the native assert() implementation now avaiable in 'js -t'Brian Gianforcaro
Switch the LibJS test suite to use the native assert implementation surfaced inside the js repl when it's launched in test mode.
2020-04-05Lagom: Add clang address/memory/undefined-behavior analyzer supportBrian Gianforcaro
Adding the ability to turn on Clang analyzer support in the Lagom build. Right now the following are working warning free on the LibJS test suite: -DENABLE_MEMORY_SANITIZER:BOOL=ON -DENABLE_ADDRESS_SANITIZER:BOOL=ON The following analyzer produces errors when running the LibJS test suite: -DENABLE_UNDEFINED_SANITIZER:BOOL=ON
2020-04-05LibJS: Plumb line and column information through Lexer / ParserBrian Gianforcaro
While debugging test failures, it's pretty frustrating to have to go do printf debugging to figure out what test is failing right now. While watching your JS Raytracer stream it seemed like this was pretty furstrating as well. So I wanted to start working on improving the diagnostics here. In the future I hope we can eventually be able to plumb the info down to the Error classes so any thrown exceptions will contain enough metadata to know where they came from.
2020-04-05AK: Stop allowing implicit downcast with OwnPtr and NonnullOwnPtrAndreas Kling
Same issue here as we had with RefPtr and NonnullRefPtr. Since we can't make copies of an owning pointer, we don't get quite the same static_ptr_cast<T> here. Instead I've only added a new templated version of OwnPtr::release_nonnull() in this patch, to solve the only issue that popped up. I'm not sure what the best solution here is, but this works for now.
2020-04-05AK: Stop allowing implicit downcast with RefPtr and NonnullRefPtrAndreas Kling
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-05LibJS: Fix missing paren in modulo-basic.js testAndreas Kling
2020-04-05LibJS: Add support for Math.ceil() and Math.trunc()Brian Gianforcaro
Introduce support for the both of these Math methods. Math.trunc is implemented in terms of Math.ceil or Math.floor based on the input value. Added tests as well.
2020-04-05LibJS: Add support for floating point modulousBrian Gianforcaro
This change implements floating point mod based on the algorithm used in LibM's fmod() implementation. To avoid taking a dependency on LibM from LibJS I reimplemented the formula in LibJS. I've incuded some of the example MDM test cases as well. This surfaced and issue handling NaN which I've fixed as well.