summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2021-06-26Revert "LibJS: Fix this_value in native setters and getters"davidot
This reverts commit f102b563 The reverted to behavior is not correct for example with a double proxy But this change lead to problems with DOMNodes
2021-06-26LibJS: Fix propagation of setters and getters from prototypesdavidot
If we define a property with just a setter/getter (not both) we must: - take the previous getter/setter if defined on the actual object - overwrite the other to nullptr if it is from a prototype
2021-06-26LibJS: Allow setting the length of an object with prototype Arraydavidot
Before this it would always go through the native setter thus modifying the array but now you can set length to anything
2021-06-26LibJS: Don't remove non-configurable items in Array when setting lengthdavidot
2021-06-26LibJS: Make Array.prototype.lastIndexOf slightly more spec compliantdavidot
2021-06-26LibJS: Make sure `this` in the global environment is the global objectAndreas Kling
Fixes regressed with 0f9038b732a6e0f5830e5e95c0b2a1c78efea415.
2021-06-26LibJS+LibCrypto: Allow '_' as a numeric literal separator :^)Andreas Kling
This patch adds support for the NumericLiteralSeparator concept from the ECMAScript grammar.
2021-06-26LibJS: Fix spelling mistake in one of the syntax error descriptionsAndreas Kling
2021-06-26LibJS: Add %TypedArray%.prototype.entriesLuke
2021-06-26LibJS: Add %TypedArray%.prototype.valuesLuke
2021-06-26LibJS: Add %TypedArray%.prototype.keysLuke
2021-06-26LibJS: Add TypedArray support to ArrayIteratorLuke
ArrayIteratorPrototype::next seems to implement CreateArrayIterator, which is an issue for a separate PR.
2021-06-26LibJS: Align ObjectEnvironmentRecord member names with the specAndreas Kling
In the spec, object environments have a [[BindingObject]], so let's call it the same thing in our implementation.
2021-06-26LibJS: Remove unnecessary GlobalObject& member on global environmentAndreas Kling
We already store the GlobalObject& in a base class, so no need to also store it in the subclass. :^)
2021-06-26LibJS: Create new object earlier in VM::construct()Andreas Kling
Also make use of OrdinaryCreateFromConstructor() instead of setting the prototype manually. This fixes 2 function tests in test262. :^)
2021-06-25LibJS: Change PropertyName(i32) => template<Integral T> PropertyName(T)Linus Groh
Negative numeric properties are not a thing (and we even VERIFY()'d this in the constructor). It still allows using types with a negative range for now as we have various places using int for example (without actually needing the negative range, but that's a different story). u32 is the internal type of `m_number` already, so this now allows us to leverage the full u32 range for numeric properties.
2021-06-25LibJS: Change PropertyName(Symbol*) => PropertyName(Symbol&)Linus Groh
Requires a bunch of find-and-replace updates across LibJS, but constructing a PropertyName from a nullptr Symbol* should not be possible - let's enforce this at the compiler level instead of using VERIFY() (and already dereference Symbol pointers at the call site).
2021-06-25LibJS: Rename ScriptFunction::m_parent_scope => m_environmentAndreas Kling
This is for the [[Environment]] slot so let's have a matching name. :^)
2021-06-25LibJS: Add the Function.[[ThisMode]] fieldAndreas Kling
This is not a behavioral change in itself, just prep work for future spec-compliance changes.
2021-06-25LibJS: FunctionEnvironment.[[FunctionObject]] is the *invoked* functionAndreas Kling
We were setting the wrong [[FunctionObject]] on the environment when going through ProxyObject and BoundFunction.
2021-06-25LibJS: Rename the context in Call/Construct ops to "callee context"Andreas Kling
This matches what the spec calls them.
2021-06-25LibJS: Make assertion in BindThisValue mirror the spec exactly :^)Andreas Kling
2021-06-25Userland: Add FB_FLUSH ioctl for fbdevSahan Fernando
2021-06-25LibGUI: Add TextEditor::has_document()Itamar
2021-06-25LibAudio: Implement a basic FLAC loaderkleines Filmröllchen
This commit adds a loader for the FLAC audio codec, the Free Lossless Audio codec by the Xiph.Org foundation. LibAudio will automatically read and parse FLAC files, so users do not need to adjust. This implementation is bare-bones and needs to be improved upon. There are many bugs, verbatim subframes and any kind of seeking is not supported. However, stereo files exported by libavcodec on highest compression setting seem to work well.
2021-06-25LibAudio: Make ResampleHelper templated for different sample typeskleines Filmröllchen
Previously, ResampleHelper was fixed on handling double's, which makes it unsuitable for the upcoming FLAC loader that needs to resample integers. For this reason, ResampleHelper is templated to support theoretically any type of sample, though only the necessary i32 and double are templated right now. The ResampleHelper implementations are moved from WavLoader.cpp to Buffer.cpp. This also improves some imports in the WavLoader files.
2021-06-25LibAudio: Make LoaderPlugin::error_string return String&kleines Filmröllchen
Previously, error_string() returned char* which is bad Serenity style and caused issues when other error handling methods were tried. As both WavLoader and (future) FLAC loader store a String internally for the error message, it makes sense to return a String reference instead.
2021-06-25LibAudio: Add the Int32 sample formatkleines Filmröllchen
The signed 32-bit PCM sample format is required for the FLAC standard.
2021-06-25LibCore: Add InputFileStream::seekkleines Filmröllchen
As a file is able to seek(), InputFileStreams can delegate the seek() easily. This allows for seeking to specific locations in the file.
2021-06-25LibJS: Make sure to always initialize Reference::m_base_valueAndreas Kling
2021-06-25LibJS: Rename Reference methods to match the specAndreas Kling
- get -> get_value (GetValue in the spec) - put -> put_value (PutValue in the spec) Also add spec links. :^)
2021-06-25LibJS: Bring Reference records a bit closer to the ECMAScript specAndreas Kling
Our Reference class now has the same fields as the spec: - Base (a non-nullish value, an environment record, or `unresolvable`) - Referenced Name (the name of the binding) - Strict (whether the reference originated in strict mode code) - ThisValue (if non-empty, the reference represents a `super` keyword) The main difference from before is that we now resolve the environment record that a reference interacts with. Previously we simply resolved to either "local variable" or "global variable". The associated abstract operations are still largely non-conforming, since we don't yet implement proper variable bindings. But this patch should at least fix a handful of test262 cases. :^) There's one minor regression: some TypeError message strings get a little worse due to doing a RequireObjectCoercible earlier in the evaluation of MemberExpression.
2021-06-25LibJS: Evaluate `this` in terms of ResolveThisBindingAndreas Kling
2021-06-25LibJS: Remove outdated FIXME in GetThisEnvironmentAndreas Kling
2021-06-25LibJS: Rename VM::get_reference() => resolve_binding()Andreas Kling
This function maps to the ResolveBinding operation from the spec, so let's rename it to match.
2021-06-25LibWeb: Support :active pseudo-class for hyperlinks, :focus possiblyPaul Irwin
Adds support for the :active pseudo-class for hyperlinks (<a> tags only). Also, since it was very similar to :focus and an element having a focused state was already implemented, I went ahead and implemented that pseudo-class too, although I cannot come up with a working example to validate it.
2021-06-25LibGUI: Add alternate shortcut F5 to the "reload" common actionAatos Majava
2021-06-25LibGUI: Make Action::shortcut() return const&Aatos Majava
Also do the same for Action::alternate_shortcut().
2021-06-25LibGUI: Add a new constructor to ActionAatos Majava
This constructor allows you to omit the modifier keys. Instead of doing "{ 0, Key_F5 }" you can now just do "Key_F5"
2021-06-25LibGUI: Actually use the Action alternate shortcutAatos Majava
This adds the actual functionality to Window and Application.
2021-06-25LibGUI: Add support for an alternate keyboard shortcut in ActionAatos Majava
This patch adds the alternate_shortcut member to LibGUI::Action, which enables one Action to have two keyboard shortcuts. Note that the string used in menus and tooltips only shows the main shortcut, which is the same behaviour as in Firefox and Chrome.
2021-06-24LibGUI: Add update() when changing widget color or paletteSpencer Dixon
2021-06-24Userland: Replace VERIFY(is<T>) with verify_cast<T>Andreas Kling
Instead of doing a VERIFY(is<T>(x)) and *then* casting it to T, we can just do the cast right away with verify_cast<T>. :^)
2021-06-24LibJS: Protect execution context variable environments from GCAndreas Kling
At the moment these environments are always the same as the lexical ones, so this didn't cause any trouble. Once we start separating them we have to make sure both environments are protected.
2021-06-24AK: Rename downcast<T> => verify_cast<T>Andreas Kling
This makes it much clearer what this cast actually does: it will VERIFY that the thing we're casting is a T (using is<T>()).
2021-06-24LibJS: Rename ExecutionContext::callee => functionAndreas Kling
This matches what ECMAScript calls it. Also make it a JS::Function* instead of a generic Value, since it will always either be a function object or null.
2021-06-24LibJS: Rename CallFrame => ExecutionContextAndreas Kling
This struct represents what the ECMAScript specification calls an "execution context" so let's use the same terminology. :^)
2021-06-24LibVT: Only resize the line after all rewrapping is doneAli Mohammad Pur
Otherwise we would end up inserting empty cells into the wrapped lines. Fixes #8227.
2021-06-24LibCore+AK: Use proper atomics in `Singleton`Daniel Bertalan
2021-06-24LibGfx: Don't `constexpr` functions returning StringsDaniel Bertalan
Since strings don't have a constexpr constructor, these won't have any effect anyways. Furthermore, this is explicitly disallowed by the standard, and makes Clang tools freak out.