Age | Commit message (Collapse) | Author |
|
|
|
BooleanPrototype should inherit from Object, not BooleanObject.
|
|
This patch adds very basic XMLHttpRequest support to LibWeb. Here's an
example that currently works:
var callback = function() { alert(this.responseText); }
var xhr = new XMLHttpRequest();
xhr.addEventListener("load", callback);
xhr.open("GET", "http://serenityos.org/~kling/test/example.txt");
xhr.send();
There are many limitations and bugs, but it's pretty dang awesome that
we have XHR. :^)
|
|
|
|
|
|
Many other parsers call it with this name.
Also Type can be confusing in this context since the DeclarationType is
not the type (number, string, etc.) of the variables that are being
declared by the VariableDeclaration.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This patch only adds the AST node, the parser doesn't create them yet.
|
|
Also updated the object-basic.js test to include this change
|
|
|
|
|
|
|
|
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.
|
|
|
|
I had this out of line for debugging reasons. Put it back inline.
|
|
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.
|
|
This avoids one malloc/free pair for every function call if there are
8 arguments or fewer.
|
|
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. :^)
|
|
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. :^)
|
|
To prevent the heap from growing infinitely large, we now do a full GC
every 10'000 allocations. :^)
|
|
In some of the tests in Math.min.js, we were testing Math.max() instead
of Math.min()
|
|
|
|
Otherwise the garbage collector will eat them way too soon! This made
it impossible to use "js -g" without crashing.
|
|
|
|
|
|
|
|
We were creating a temporary AK::Function for no good reason, and this
was dominating profiles. Reorganize the code so it's not necessary.
|
|
|
|
|
|
|
|
|
|
Before this patch the parser accepted conditions without enclosing
parentheses (like: .."while number < 9").
|
|
|
|
|
|
|
|
By borrowing an "expect close" function from LibM/TestMath.cpp, we can
make this a lot simpler. Also the parser now understands decimals!
|
|
Uncomment lines that are now parsing correctly :^)
|
|
The value of Math.SQRT1_2 was zero as we were dividing two integers.
|
|
|
|
|
|
|
|
Switch the LibJS test suite to use the native assert implementation
surfaced inside the js repl when it's launched in test mode.
|
|
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
|
|
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.
|
|
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. :^)
|