summaryrefslogtreecommitdiff
path: root/Tests
AgeCommit message (Collapse)Author
2022-02-08LibJS+Everywhere: Remove VM::exception() and most related functionsdavidot
This commit removes all exception related code: Remove VM::exception(), VM::throw_exception() etc. Any leftover throw_exception calls are moved to throw_completion. The one method left is clear_exception() which is now a no-op. Most of these calls are just to clear whatever exception might have been thrown when handling a Completion. So to have a cleaner commit this will be removed in a next commit. It also removes the actual Exception and TemporaryClearException classes since these are no longer used. In any spot where the exception was actually used an attempt was made to preserve that behavior. However since it is no longer tracked by the VM we cannot access exceptions which were thrown in previous calls. There are two such cases which might have different behavior: - In Web::DOM::Document::interpreter() the on_call_stack_emptied hook used to print any uncaught exception but this is now no longer possible as the VM does not store uncaught exceptions. - In js the code used to be interruptable by throwing an exception on the VM. This is no longer possible but was already somewhat fragile before as you could happen to throw an exception just before a VERIFY.
2022-02-08LibJS: Convert Instruction::execute in bytecode to ThrowCompletionOrdavidot
This allows us to use TRY in these functions :^).
2022-02-08LibJS: Convert ArrayBuffer construction to ThrowCompletionOrdavidot
This also allows us to create TypedArrays with an existing buffer thus clearing up an additional FIXME in TextEncoder.
2022-02-06AK: Introduce IntegralMath.h starting with pow<I>Hendiadyoin1
2022-02-06LibCore+Userland: Remove Core::TCPSocket :^)sin-ack
This was deprecated in favor of Core::Stream::TCPSocket, and now has no users.
2022-02-06LibCrypto: Do not allow signed big integers to be negative zeroTimothy Flynn
If a big integer were to become negative zero, set the sign to instead be positive. This prevents odd scenarios where users of signed big ints would falsely think the result of some big int arithmetic is negative.
2022-02-06Userland: Convert TLS::TLSv12 to a Core::Stream::SocketAli Mohammad Pur
This commit converts TLS::TLSv12 to a Core::Stream object, and in the process allows TLS to now wrap other Core::Stream::Socket objects. As a large part of LibHTTP and LibGemini depend on LibTLS's interface, this also converts those to support Core::Stream, which leads to a simplification of LibHTTP (as there's no need to care about the underlying socket type anymore). Note that RequestServer now controls the TLS socket options, which is a better place anyway, as RS is the first receiver of the user-requested options (though this is currently not particularly useful).
2022-02-06LibCore: Remove Core::LocalSocket :^)sin-ack
2022-02-05LibRegex: Support non-ASCII whitespace characters when matching \s or \STimothy Flynn
ECMA-262 defines \s as: Return the CharSet containing all characters corresponding to a code point on the right-hand side of the WhiteSpace or LineTerminator productions. The LineTerminator production is simply: U+000A, U+000D, U+2028, or U+2029. Unfortunately there isn't a Unicode property that covers just those code points. The WhiteSpace production is: U+0009, U+000B, U+000C, U+FEFF, or any code point with the Space_Separator general category. If the Unicode generators are disabled, this will fall back to ASCII space code points.
2022-02-05LibSQL: Implement DESCRIBE TABLE testsMahmoud Mandour
2022-02-05LibJS+LibRegex: Don't repeat regex match in regexp_exec()Ali Mohammad Pur
LibRegex already implements this loop in a more performant way, so all LibJS has to do here is to return things in the right shape, and not loop over the input string. Previously this was a quadratic operation on string length, which lead to crazy execution times on failing regexps - now it's nice and fast :^) Note that a Regex test has to be updated to remove the stateful flag as it repeats matching on multiple strings.
2022-02-05LibRegex+LibJS: Avoid searching for more than one match in JS RegExpsAli Mohammad Pur
All of JS's regular expression APIs only want a single match, so avoid trying to produce more (which will be discarded anyway).
2022-02-01Everywhere: Fully qualify font names by including their slopethankyouverycool
Fixes typefaces of the same weight but different slopes being incorrectly returned for each other by FontDatabase.
2022-01-31Everywhere: Update copyrights with my new serenityos.org e-mail :^)Timothy Flynn
2022-01-31LibJS: Store ECMAScriptFunctionObject bytecode in an OwnPtrAndreas Kling
Using an Optional was extremely wasteful for function objects that don't even have a bytecode executable. This allows ECMAScriptFunctionObject to fit in a smaller size class.
2022-01-30AK+Tests: Make null strings compare less than non-null stringsDaniel Bertalan
This behavior regressed in ca58c71faa6e31721b6094d380732d2aa6f3d791. Fixes #12213
2022-01-30AK: Disable the empty-string-vs-null-string test until we have a fixAndreas Kling
2022-01-30Tests: Add test for null string and empty string to be unequalnetworkException
See #12213
2022-01-25Tests+LibJS: Add very simple bytecode LibJS testsdavidot
These tests are not meant as a replacement to test-js with the -b option but are meant to test simple cases until that works. Before this it was very easy to accidentally break bytecode since no tests were run in bytecode mode. This hopefully makes it easier to spot such regressions :^).
2022-01-26LibRegex: Implement ECMA262 multiline matching without splitting linesAli Mohammad Pur
As ECMA262 regex allows `[^]` and literal newlines to match newlines in the input string, we shouldn't split the input string into lines, rather simply make boundaries and catchall patterns capable of checking for these conditions specifically.
2022-01-25LibC: Ensure most time tests run under UTCTimothy Flynn
This ensures these tests pass even if the user has changed the system time zone away from UTC.
2022-01-25LibC: Implement tzset with time zone awareness in accordance with POSIXTimothy Flynn
2022-01-25LibTimeZone: Handle time zones which begin the year in daylight savingsTimothy Flynn
2022-01-25LibTimeZone: Add an API to retrieve both daylight and standard offsetsTimothy Flynn
This API will also include the formatted name of the time zone, with respect for DST (e.g. EST vs EDT for America/New_York).
2022-01-24AK+Userland: Make AK::decode_base64 return ErrorOrSam Atkins
2022-01-24Everywhere: Convert ByteBuffer factory methods from Optional -> ErrorOrSam Atkins
Apologies for the enormous commit, but I don't see a way to split this up nicely. In the vast majority of cases it's a simple change. A few extra places can use TRY instead of manual error checking though. :^)
2022-01-24LibEDID: Fix handling extension mapsTom
We weren't properly iterating the extension blocks and thought we encountered an unexpected extension map block, when we really should have just skipped over it.
2022-01-24LibCore: Improve handling of parsing errors in FilePermissionsMaskXavier Defrang
2022-01-24LibCore: Restore support for multiple symbolic classesXavier Defrang
Reverts recent change introduced to support implicit symbolic permission which broke the parser when multiple classes are specified. The state machine must assume it's dealing with classes until an operation character is consumed.
2022-01-23LibEDID: Add a library to parse EDID blobsTom
This library can be used (for the most part) by kernel drivers as well as user mode. For this reason FixedPoint is used rather than floating point, but kept to a minimum.
2022-01-23AK: Add FixedPoint cast operator for up/downcasting to other sizesTom
This enables casting between different size FixedPoint variables or constructing them from other sized FixedPoint values.
2022-01-23AK: Add Formatter<FixedPoint<...>> without floating pointTom
Rather than casting the FixedPoint to double, format the FixedPoint directly. This avoids using floating point instruction, which in turn enables this to be used even in the kernel.
2022-01-23LibSQL: Add simple REGEXP matchmnlrsn
The implementation of LIKE uses regexes under the hood, and this implementation of REGEXP takes the same approach. It employs PosixExtended from LibRegex with case insensitive and Unicode flags set. The implementation of LIKE is based on SQLlite specs, but SQLlite does not offer directions for a built-in regex functionality, so this one uses LibRegex.
2022-01-23Everywhere: Convert VM::call() to JS::call()mjz19910
2022-01-23LibCore: Allow EventLoops to run on multiple threads safelykleines Filmröllchen
The event loop system was previously very singletony to the point that there's only a single event loop stack per process and only one event loop (the topmost) can run at a time. This commit simply makes the event loop stack and related structures thread-local so that each thread has an isolated event loop system. Some things are kept at a global level and synchronized with the new MutexProtected: The main event loop needs to still be obtainable from anywhere, as it closes down the application when it exits. The ID allocator is global as IDs should not be shared even between threads. And for the inspector server connection, the same as for the main loop holds. Note that currently, the wake pipe is only created by the main thread, so notifications don't work on other threads. This removes the temporary mutex fix for notifiers, introduced in 0631d3fed5623c1f2b0d6085ab24e4dd69c6ce99 .
2022-01-23LibJS+LibTimeZone+LibUnicode: Remove direct linkage to LibTimeZoneTimothy Flynn
This is no longer needed now that LibTimeZone is included within LibC. Remove the direct linkage so that others do not mistakenly copy-paste the CMakeLists text elsewhere.
2022-01-22LibRegex: Allow ClearCaptureGroup to create new groupsAli Mohammad Pur
Instead of leaking all capture groups and selectively clearing some, simply avoid leaking things and only "define" the ones that need to exist. This *actually* implements the capture groups ECMA262 quirk. Also adds the test removed in the previous commit (to avoid messing up test runs across bisects).
2022-01-22Revert "LibRegex: Implement an ECMA262 Regex quirk with negative loo..."Ali Mohammad Pur
This partially reverts commit c11be92e23d899e28d45f67be24e47b2e5114d3a. That commit fixes one thing and breaks many more, a next commit will implement this quirk in a more sane way.
2022-01-21LibRegex: Allow the pattern to match the zero-length end of the stringAli Mohammad Pur
...only if Multiline is not enabled. Fixes #11940.
2022-01-21LibRegex: Implement an ECMA262 Regex quirk with negative lookaroundsAli Mohammad Pur
This implements the quirk defined by "Note 3" in section "Canonicalize" (https://tc39.es/ecma262/#sec-runtime-semantics-canonicalize-ch). Crosses off another quirk from #6042.
2022-01-21LibRegex: Correct jump offset to the start of the loop blockAli Mohammad Pur
Previously we were jumping to the new end of the previous block (created by the newly inserted ForkStay), correct the offset to jump to the correct block as shown in the comments. Fixes #12033.
2022-01-20Tests: Add should_error_when_connection_fails test to TestLibCoreStreamsin-ack
This test makes sure that Socket classes such as TCPSocket properly return an error when connection fails rather than crashing or creating an invalid object.
2022-01-20Tests: Fix the TestLibCoreStream local_socket_write testsin-ack
Accidentally regressed this test during the Core::LocalServer refactor, and didn't catch it since TestLibCoreStream is disabled in the CI right now. We have to wait for some data to become available, as pending_bytes will immediately return 0 and a 0-sized read immediately returns.
2022-01-19LibJS+LibUnicode: Return the appropriate time zone name depending on DSTTimothy Flynn
2022-01-19LibJS+LibTimeZone+LibUnicode: Indicate whether a time zone is in DSTTimothy Flynn
Return whether the time zone is in DST during the provided time from TimeZone::get_time_zone_offset,
2022-01-19LibJS+LibTimeZone: Begin handling DST when computing time zone offsetsTimothy Flynn
This also updates some expectations in a Temporal time zone offset test that is using a time stamp which is in DST for a few time zones.
2022-01-18LibCrypto+LibJS: Better bitwise binary_xor binopNico Weber
We went through some trouble to make & and | work right. Reimplement ^ in terms of & and | to make ^ work right as well. This is less fast than a direct implementation, but let's get things working first.
2022-01-18LibCrypto+LibJS: Better bigint bitwise_or binopNico Weber
Similar to the bitwise_and change, but we have to be careful to sign-extend two's complement numbers only up to the highest set bit in the positive number.
2022-01-18LibCrypto+LibJS: Better bigint bitwise_and binopNico Weber
Bitwise and is defined in terms of two's complement, so some converting needs to happen for SignedBigInteger's sign/magnitude representation to work out. UnsignedBigInteger::bitwise_not() is repurposed to convert all high-order zero bits to ones up to a limit, for the two's complement conversion to work. Fixes test262/test/language/expressions/bitwise-and/bigint.js.
2022-01-18LibJS+LibCrypto: Fix SignedBitInteger::bitwise_not and use it in LibJSNico Weber
Bitwise operators are defined on two's complement, but SignedBitInteger uses sign-magnitude. Correctly convert between the two. Let LibJS delegate to SignedBitInteger for bitwise_not, like it does for all other bitwise_ operations on bigints. No behavior change (LibJS is now the only client of SignedBitInteger::bitwise_not()).