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. :^)
Previously windows would either extend past the screen or stay at their
previous smaller size in the corner, now they are resized to fit the new
resolution.
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.
This patch adds String.prototype.charAt() to demonstrate that prototype
property lookup works, and that you can call a prototype function on an
object, and it will do what you expect. :^)
Object will now traverse up the prototype chain when doing a get().
When a function is called on an object, that object will now also be
the "this" value inside the function. This stuff is probably not very
correct, but we will improve things as we go! :^)
The kernel was already using the UDP prefix, and the TCP LibCore classes
are also uppercased. Let's rename for consistency.
Also order the LibCore Makefile alphabetically, because everywhere else
seems to be doing that :)
We now evaluate for loops in their own scope if their init statement is
a lexical declaration.
Evaluating for loops in their own scope allow us to obtain expected
behaviour, which means for example, that the block-scoped variables
declared in a for statement will be limited to the scope of the for
loop's body and statement and not to that of the current scope (i.e the
one where the for statement was made)
This patch introduces the Wrapper and Wrappable classes.
Node now inherits from Wrappable, and can be wrapped in a GC-allocated
Bindings::NodeWrapper object. The only property we expose right now is
the very simple nodeName property.
When a Document's JS::Interpreter is first instantiated, we add a
"document" property with a DocumentWrapper object to the global object.
This is pretty cool! :^)
This patch begins integrating LibJS into LibWeb. Document holds the
JS::Interpreter for now, and it is created on demand when you first
call Document::interpreter().
We also add a simple "alert()" function to the global object.
Previously, we were allowing the redeclaration of a variable with `let`
or `const` if it was declared initially using `var`, we should not
tolerate any form of variable redeclaration using let/const.