summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2021-03-16LibGfx: Rename 32-bit bitmap StorageFormats to BGRA8888 and BGRx8888Andreas Kling
2021-03-16LibGfx: Rename 32-bit BitmapFormats to BGRA8888 and BGRx888xAndreas Kling
The previous names (RGBA32 and RGB32) were misleading since that's not the actual byte order in memory. The new names reflect exactly how the color values get laid out in bitmap data.
2021-03-16LibJS: Make an RAII helper for entering/exiting AST nodesAndreas Kling
2021-03-16LibJS: Implement non-value-producing statements properlyLinus Groh
For various statements the spec states: Return NormalCompletion(empty). In those cases we have been returning undefined so far, which is incorrect. In other cases it states: Return Completion(UpdateEmpty(stmtCompletion, undefined)). Which essentially means a statement is evaluated and its completion value returned if non-empty, and undefined otherwise. While not actually noticeable in normal scripts as the VM's "last value" can't be accessed from JS code directly (with the exception of eval(), see below), it provided an inconsistent experience in the REPL: > if (true) 42; 42 > if (true) { 42; } undefined This also fixes the case where eval() would return undefined if the last executed statement is not a value-producing one: eval("1;;;;;") eval("1;{}") eval("1;var a;") As a consequence of the changes outlined above, these now all correctly return 1. See https://tc39.es/ecma262/#sec-block-runtime-semantics-evaluation, "NOTE 2". Fixes #3609.
2021-03-16LibJS: Make Interpreter::run() a void functionLinus Groh
With one small exception, this is how we've been using this API already, and it makes sense: a Program is just a ScopeNode with any number of statements, which are executed one by one. There's no explicit return value at the end, only a completion value of the last value-producing statement, which we then access using VM::last_value() if needed (e.g. in the REPL).
2021-03-15LibGfx: Draw window frame icon scaled to title_bar_icon_rect()Linus Groh
Partially fixes #5806.
2021-03-15LibJS: Throw SyntaxError in eval() when parser has error(s)Linus Groh
2021-03-15LibM: Implement fmin/fmaxMițca Dumitru
2021-03-15LibM: Make the gamma family of functions more accurate and conformantMițca Dumitru
This patch makes tgamma use an approximation that is more accurate with regards to floating point arithmetic, and fixes some issues when tgamma was called with positive integer values. It also makes lgamma set signgam to the correct value, and makes its return value be more inline with what the C standard defines.
2021-03-15LibM: Declare rintl in math.hMițca Dumitru
2021-03-15LibJS: Make eval() return the last value from the executed statementAndreas Kling
This is kinda awkward but since the statement we're executing is actually a JS::Program, we have to get the result via VM::last_value().
2021-03-15LibCompress+AK: Propagate error handling to wrapped streamsIdan Horowitz
This ensures that when a DeflateCompressor stream is cleared of any errors its underlying wrapped streams (InputBitStream/InputMemoryStream) will be cleared as well and wont fail a VERIFY on destruction.
2021-03-15LibCompress: Make the Zlib decompressor fail gracefulyIdan Horowitz
This commit adds a verify-less try_create method to the Zlib decompressor to allow for graceful failures of parsing the Zlib headers.
2021-03-15LibWeb: Make sure <script> elements get prepared when connectedAndreas Kling
There's a bit more nuance to how this should really work, but let's at least make sure we execute <script> elements if you insert them into the document.
2021-03-15LibWeb: Add CanvasRenderingContext2D.clearRect()Andreas Kling
Similar to fillRect, except this API fills with transparent black.
2021-03-15LibWeb: Support named CSS properties on CSSStyleDeclaration wrapperAndreas Kling
Use the new CustomGet/CustomPut wrapper mechansim to intercept gets and puts on CSSStyleDeclaration objects. This allows content to get and set individual CSS properties from JavaScript. :^)
2021-03-15LibWeb: Allow JS wrappers to customize get() and put()Andreas Kling
You can now set the CustomGet and/or CustomPut extended attributes on an interface. This allows you to override JS::Object::get/put in the wrapper class.
2021-03-15LibWeb: Make <option> elements display:none in the default CSS for nowAndreas Kling
2021-03-15LibJS: Add arguments.callee to our hack arguments objectAndreas Kling
arguments.callee refers to the currently executing function.
2021-03-15LibJS: Add Date.prototype.toGMTString()Andreas Kling
2021-03-15LibWeb: Stub out Document.cookieAndreas Kling
We don't get/set anything, but at least scripts that access document cookies can now progress further. :^)
2021-03-15LibJS: Partial support for Date.prototype.setFullYear()Andreas Kling
2021-03-15LibJS: Add naive implementation of eval() :^)Andreas Kling
This parses and executes a code string in the caller's lexical scope.
2021-03-15LibTextCodec: Make UTF16BEDecoder read only up to an even offsetIdan Horowitz
Reading up to the end of the input string of odd length results in an out-of-bounds read
2021-03-15LibGUI: Fix crash when text_in_range() was called on an empty documentCesar Torres
2021-03-15LibELF+LibTest: Fix serenity_install_sources() pathsLinus Groh
Currently we end up with the following: serenity/ AK/ ... Kernel/ ... Libraries/ LibELF/ LibTest/ Userland/ Libraries/ <all other libs> ...
2021-03-14LibM: Add remainder{f, l}Mițca Dumitru
These just forward their arguments to fmod, but I think that should be fine.
2021-03-14LibM: Define HUGE_VAL{F,L} in terms of compiler builtinsMițca Dumitru
2021-03-14LibM: Define MAXFLOATMițca Dumitru
Looks like a POSIX extension
2021-03-14LibM: Define FLT_EVAL_METHOD, float_t and double_tMițca Dumitru
2021-03-14LibM: Declare ldexpl in math.hMițca Dumitru
It was already defined, but it wasn't declared in the header
2021-03-14LibM: Add the gamma family of functionsMițca Dumitru
2021-03-14LibM: Organise math.h so it is less of a wall of functionsMițca Dumitru
The categories are the same categories used by cppreference on its page for numeric functions.
2021-03-14LibM: Implement the missing parts of the round familyMițca Dumitru
2021-03-14LibM: Add missing float and long double function variantsMițca Dumitru
2021-03-14LibJS: Change non-ScriptFunction source string to "[native code]"Linus Groh
https://tc39.es/ecma262/#sec-function.prototype.tostring - this is how the spec wants us to do it. :^) Also change the function name behaviour to only provide a name for NativeFunctions, which matches other engines - presumably to not expose Proxy objects, and to prevent "function bound foo() { [native code] }".
2021-03-14LibJS: Don't try to derive function source from ProxyObjectLinus Groh
There are three JS::Function types that are not ScriptFunction: NativeFunction, BoundFunction and ProxyObject. We were only checking for the first two when determining whether to reconstruct the function's source code, which was leading to a bad cast to ScriptFunction. Since only ScriptFunction has the [[SourceText]] internal slot, I simply swapped the branches here. Fixes #5775.
2021-03-14LibCompress: Decrease CanonicalCode's size on stackIdan Horowitz
This commit stores the bit codes as u16s instead of u32s as the maximum code bit length in DEFLATE is 15.
2021-03-14LibJS: Fix some issues in RegExp.prototype[@@match]Linus Groh
- We were not passing the to_string()'d argument to the exec function but the original argument - We were leaking an empty value in two cases, which almost certainly will crash something down the line - We were not checking for exceptions after to_string() and get(), which both may throw. If the getter is an accessor, it'll assert upon being called with the VM already storing an exception.
2021-03-14LibJS: Fix String.prototype.match() for non-string argumentLinus Groh
This is supposed to pass the to_string()'d argument to @@match, not the this value.
2021-03-14LibJS: Fix flags check in regexp_create()Linus Groh
We need to check for undefined, not empty - otherwise it will literally use "undefined" as the flags, which will fail (Invalid RegExp flag 'n').
2021-03-14LibJS: Add the same Object::invoke() overloads as VM::call()Linus Groh
2021-03-14LibC: Rename feclearexcept{s,}Ben Wiederhake
This will also help with making ports compile again :D https://github.com/SerenityOS/serenity/pull/5762#issuecomment-798779561
2021-03-14LibTextCodec: Fix IBM666 => IBM866 typoLuke
2021-03-14LibCompress: Handle literal only lz77 streams in DeflateCompressorIdan Horowitz
Very incompressible data could sometimes produce no backreferences which would result in no distance huffman code being created (as it was not needed), so VERIFY the code exists only if it is actually needed for writing the stream.
2021-03-14LibJS: Implement (mostly) String.prototype.matchAndreas Kling
JavaScript has a couple of different ways to run a regular expression on a string. This adds support for one more. :^)
2021-03-13LibCompress: Replace goto with simple recursion in DeflateCompressorIdan Horowitz
This is just a bit easier on the eyes :^)
2021-03-13LibM: Implement tanf() in terms of tan() with castsLinus Groh
Lazy, but it works for now. :^)
2021-03-13LibWeb: Expose barebones CSSStyleDeclaration to JavaScriptAndreas Kling
You can now access an element's inline style via Element.style. The interface is not very capable yet though. :^)
2021-03-13LibWeb: Rename StyleDeclaration => CSSStyleDeclaration to match CSSOMAndreas Kling