summaryrefslogtreecommitdiff
path: root/Base/home/anon/js
AgeCommit message (Collapse)Author
2020-04-23LibJS: Implement computed properties in object expressionsLinus Groh
2020-04-12LibJS: Add console.{debug,info,warn,error}()Linus Groh
2020-04-10LibJS: Add String.prototype.pad{Start,End}()Linus Groh
2020-03-30LibJS: Start implementing Date :^)Linus Groh
This adds: - A global Date object (with `length` property and `now` function) - The Date constructor (no arguments yet) - The Date prototype (with `get*` functions)
2020-03-24LibJS: Implement "throw"Andreas Kling
You can now throw an expression to the nearest catcher! :^) To support throwing arbitrary values, I added an Exception class that sits as a wrapper around whatever is thrown. In the future it will be a logical place to store a call stack.
2020-03-24LibJS: Implement basic exception throwingAndreas Kling
You can now throw exceptions by calling Interpreter::throw_exception(). Anyone who calls ASTNode::execute() needs to check afterwards if the Interpreter now has an exception(), and if so, stop what they're doing and simply return. When catching an exception, we'll first execute the CatchClause node if present. After that, we'll execute the finalizer block if present. This is unlikely to be completely correct, but it's a start! :^)
2020-03-24LibJS: Parse "try", "catch" and "finally"Andreas Kling
This is the first step towards support exceptions. :^)
2020-03-21LibJS: Delete fully-empty HeapBlocks after garbage collectionAndreas Kling
We now deallocate GC blocks when they are found to have no live cells inside them.
2020-03-21LibJS: Parse object expressions0xtechnobabble
2020-03-20LibJS: Add ArrayPrototype and implement Array.prototype.push()Andreas Kling
This function is ultimately supposed to be generic and allow any |this| that has a length property, but for now it only works on our own Array object type.
2020-03-20LibJS: Support reading/writing elements in an Array via Object get/putAndreas Kling
I'm not completely thrilled about Object::get() and Object::put() doing special-case stuff for arrays, and we should probably come up with a better abstraction for it. But at least it works for now, which is really nice. :^)
2020-03-20LibJS: Parse ArrayExpression and start implementing Array objectsAndreas Kling
Note that property lookup is not functional yet.
2020-03-17LibJS: Implement typeof operatorConrad Pankoff
2020-03-16LibJS: Replace the global print() function with console.log() :^)Andreas Kling
2020-03-16js: Fix simple scopes example0xtechnobabble
Weirdly enough, the "simple-scopes" test doesn't return undefined anymore, at first I thought the scoping was somehow broken, turns out the interpreter doesn't consider the returned y as the last evaluated value anymore, possibly because it's undefined (?).
2020-03-16LibJS: Implement abstract equality and inequality0xtechnobabble
2020-03-15LibJS: Add ObjectPrototype and implement hasOwnProperty()Andreas Kling
All Objects will now have ObjectPrototype as their prototype, unless overridden.
2020-03-15LibJS: Add StringPrototype and make it the prototype of StringObjectAndreas Kling
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. :^)
2020-03-14LibJS: Unescape strings in Token::string_value()Stephan Unverwerth
2020-03-14LibJS: Lex single quote strings, escaped chars and unterminated stringsStephan Unverwerth
2020-03-14LibJS: Add operator precedence parsingStephan Unverwerth
Obey precedence and associativity rules when parsing expressions with chained operators.
2020-03-13HackStudio: Add Javascript projectsOriko
2020-03-12LibJS: Replace $gc() hack with a NativeFunction on the global objectAndreas Kling
To make this work, also start passing Interpreter& to native functions.
2020-03-12LibJS: Add NativeFunction, a callable wrapper around a C++ lambdaAndreas Kling
This can be used to implement arbitrary functionality, callable from JavaScript. To make this work, I had to change the way CallExpression passes arguments to the callee. Instead of a HashMap<String, Value>, we now pass an ordered list of Argument { String name; Value value; }. This patch includes a native "print(argument)" function. :^)
2020-03-12Meta: Add for-loop JavaScript test programConrad Pankoff
2020-03-12LibJS: Add test for function with argumentshowar6hill
2020-03-12LibJS: Implement basic MemberExpression parsingAndreas Kling
At last we can parse "hello friends".length :^)
2020-03-12js: Take the script file as a command-line argumentAndreas Kling
Now that we have the beginnings of a parser, let's take the script to run as a command-line argument and move all the test scripts into /home/anon/js :^) To run a script, simply use "js": $ js my-script.js To get an AST dump before execution, you can use "js -A"