Age | Commit message (Collapse) | Author |
|
If we don't hit one of the inline children, we should still report that
we've hit the block itself.
|
|
|
|
They were unused. Also GTextEditor doesn't exist anymore and GCC
was silently ignoring this declaration.
|
|
|
|
This patch adds HTMLCanvasElement along with a LayoutCanvas object.
The DOM and layout parts are very similar to <img> elements.
The <canvas> element holds a Gfx::Bitmap which is sized according to
the "width" and "height" attributes on the element.
Calling .getContext("2d") on a <canvas> element gives you a context
object that draws into the underlying Gfx::Bitmap of the <canvas>.
The context weakly points to the <canvas> which allows it to outlive
the canvas element if needed.
This is really quite cool. :^)
|
|
|
|
This is pretty naive, we just walk up the prototype chain and call any
NativeProperty setter that we find. If we don't find one, we put/set
the value as an own property of the object itself.
|
|
|
|
|
|
|
|
FunctionExpression is mostly like FunctionDeclaration, except the name
is optional. Share the parsing logic in parse_function_node<NodeType>.
This allows us to do nice things like:
document.addEventListener("DOMContentLoaded", function() {
alert("Hello friends!");
});
|
|
Most of the code is shared with FunctionDeclaration, so the shared bits
are moved up into a common base called FunctionNode.
|
|
Using make<T> like this would create an unadopted object whose refcount
would never reach zero.
|
|
|
|
|
|
|
|
This is pretty heavy and unoptimized, but it will do the trick for now.
Basically, Heap now has a HashTable<HandleImpl*> and you can call
JS::make_handle(T*) to construct a Handle<T> that guarantees that the
pointee will always survive GC until the Handle<T> is destroyed.
|
|
|
|
This patch adds the EventTarget class and makes Node inherit from it.
You can register event listeners on an EventTarget, and when you call
dispatch_event() on it, the event listeners will get invoked.
An event listener is basically a wrapper around a JS::Function*.
This is pretty far from how DOM events should eventually work, but it's
a place to start and we'll build more on top of this. :^)
|
|
I'm not exactly sure why we end up in this situation, we'll have to
look into it.
|
|
|
|
This helper function takes care of pushing/popping a call frame so you
don't need to worry about it.
|
|
|
|
|
|
This allows function objects to outlive the original parsed program
without their ScopeNode disappearing.
|
|
|
|
|
|
Now that Interpreter keeps all arguments in the CallFrame stack, we can
just pass a const-reference to the CallFrame's argument vector to each
function handler (instead of copying it.)
|
|
This patch adds a CallFrame stack to Interpreter, which keeps track of
the "this" value and all argument values passed in function calls.
Interpreter::gather_roots() scans the call stack, making sure that all
argument values get marked. :^)
|
|
This is very useful for discovering collector bugs.
|
|
We now scan the stack and CPU registers for potential pointers into the
GC heap, and include any valid Cell pointers in the set of roots.
This works pretty well but we'll also need to solve marking of things
passed to native functions, since those are currently in Vector<Value>
and the Vector storage is on the heap (not scanned.)
|
|
This will be useful when implementing conservative garbage collection.
|
|
|
|
Let's try to keep LibJS tidy as it expands. :^)
|
|
|
|
This commits makes effort towards tolerating some of javascript's quirks
when it comes to its type system, note that the interpreter's way of
handling type coercion is still not mature at all, for example, we still
have to implement NaN instead of just crashing when trying to parse a
string and failing.
|
|
|
|
|
|
|
|
We were previously assuming that we were reassigning a variable even
when we were not, oops, my bad. :/
|
|
|
|
|
|
|
|
Instead of every NativeFunction callback having to ask the Interpreter
for the current "this" value and then converting it to an Object etc,
just pass "this" as an Object* directly.
|
|
This patch adds NativeProperty, which can be used to implement object
properties that have C++ getters and/or setters.
Use this to move String.prototype.length to its correct place. :^)
|
|
|
|
ioctl can now perform a request for a specific route and change
the address of it's default gateway.
|
|
All Objects will now have ObjectPrototype as their prototype, unless
overridden.
|
|
Since this is about finding the things we should *not* garabge collect,
it seemed wrong to call it "collect_something" :^)
|
|
To make sure that everyone has the same instance of StringPrototype,
hang a global prototype off of the Interpreter that can be fetched
when constructing new StringObjects.
|