Let's move towards using references over pointers in LibJS as well.
I had originally steered away from it because that's how I've seen
things done in other engines. But this is not the other engines. :^)
This patchsets adds the semantic check of two values. One first approach
was to compare the (generated) json strings of the two values. This works
out in the most cases, but not with numbers, where "1.0" and "1" in JSON
format are semantically the same. Therefore, this patch adds deep (recursive)
check of two JsonValues.
When we enter a repl we call initialize_global_object on our custom
ReplObject in order to expose REPL specific features. Specifically:
help(), exit(code), and load("file1.js", "file2.js", "fileEtc.js").
This adds a replace functionality that replaces a string that contains
occurences of a "needle" by a "replacement" value. With "all_occurences"
enabled, all occurences are being replaced, otherwise only the first
occurence is being replaced.
This adds Function::construct() for constructor function calls via `new`
keyword. NativeFunction doesn't have constructor behaviour by default,
ScriptFunction simply calls call() in construct()
LibWeb now creates a WindowObject which inherits from GlobalObject.
Allocation of the global object is moved out of the Interpreter ctor
to allow for specialized construction.
The existing Window interfaces are moved to WindowObject with their
implementation code in the new Window class.
The new Channel application menu allow offers various commands
related to the currently visible channel, including changing
the topic, kicking a user, and leaving the channel.
Use a StringBuilder instead of blindly passing a bunch of potentially
empty/null strings to the kernel. StringBuilder is more lenient and
generally more pleasant to use anyway.
Disconnecting from WindowServer without explicit calls to DestroyWindow
would leave nulled-out WeakPtr's in the AppletManager applet list.
This led to a null dereference when adding a new applet, since we were
assuming the list contained no nulled-out applets.
This patch fixes the issue by always unregistering applet windows from
the AppletManager in ~ClientConnection(). We also do an extra pass of
pruning any nulled-out WeakPtrs from the applet list when adding to it.
Fixes#1551.
* Add double number to object serializer
* Handle negative double numbers correctly
* Handle \r and \n in quoted strings independently
This improves the situation when keys contain \r or \n that currently
has the effect that "a\rkey" and "a\nkey" in an JSON object are the
same key value.
This patchset allows double numbers to be printed with the printf function.
The fraction will always be printed as 6 digit number. This can be improved :^)
This library is moved over from Shell/LineEdit and has all its
Shell-specific functionalities stripped off.
Currently it exposes some internal things, for instance
cut_mismatching_chars() and insert(); This behaviour is not the most
acceptable, however, let's just roll with it for now :^)