Age | Commit message (Collapse) | Author |
|
|
|
This will help greatly with debugging!
|
|
Skipped tests count as a "pass" rather than a "fail" (i.e. a test suite
with a skipped test will pass), however it does display a message when
the test is printing.
This is intended for tests which _should_ work, but currently do not.
This should be preferred over "// FIXME" notes if possible.
|
|
The shell script is no longer necessary -- simply run "test-js" from
inside Serenity, or $SERENITY_ROOT/Build/Meta/Lagom/test-js from the
host.
|
|
This commit also exposes JSONObject's implementation of stringify to the
public, so that it can be used by test-js without having to go through
the interpreter's environment.
|
|
|
|
|
|
|
|
|
|
Now that test-common.js is quite a bit more complicated, we need tests
for test-common to make sure all of the matchers behave correctly
|
|
First test conversions! These look really good :)
|
|
|
|
This moves most of the work from run-tests.sh to test-js.cpp. This way,
we have a lot more control over how the test suite runs, as well as how
it outputs. This should result in some cool functionality!
This commit also refactors test-common.js to mimic the jest library.
This should allow tests to be much more expressive :)
|
|
- Use emojis instead of the pass/fail text
- Fix the new version of the script to run inside Serenity
- Don't print erroneous output after 'Output:'; start on a newline
instead
- Skip 'run-tests.sh' while testing
|
|
|
|
|
|
This allows the proxy handler to pass the proper new.target to construct
handlers.
|
|
|
|
Mark a bunch of these with FIXME so that someone can find them and
fix them eventually. :^)
|
|
literal methods; add EnvrionmentRecord fields and methods to
LexicalEnvironment
Adding EnvrionmentRecord's fields and methods lets us throw an exception
when |this| is not initialized, which occurs when the super constructor
in a derived class has not yet been called, or when |this| has already
been initialized (the super constructor was already called).
|
|
and set it to the current function
|
|
Previously, debugging a test with console.log statements was impossible,
because it would just cause the test to fail with no additional output.
Now, if the output of a test is not "PASS", the output will be printed
under the line where the test failed.
Empty output will have a special message attached to it -- useful when
a test author has forgotten to include `console.log("PASS")` at the end
of a test.
|
|
|
|
|
|
|
|
|
|
Now, exceptions can be thrown with
interpreter.throw_exception<T>(ErrorType:TYPE, "format", "args",
"here").
|
|
|
|
Includes all traps except the following: [[Call]], [[Construct]],
[[OwnPropertyKeys]].
An important implication of this commit is that any call to any virtual
Object method has the potential to throw an exception. These methods
were not checked in this commit -- a future commit will have to protect
these various method calls throughout the codebase.
|
|
|
|
This patch adds function declaration hoisting. The mechanism
is similar to var hoisting. Hoisted function declarations are to be put
before the hoisted var declarations, hence they have to be treated
separately.
|
|
This makes `typeof i_dont_exist` return `undefined` instead of
throwing an error.
|
|
|
|
|
|
|
|
Object::set_prototype() now returns a boolean indicating success.
Setting the prototype to an identical object is always considered
successful, even if the object is non-extensible.
|
|
We're crashing otherwise. Also it was not possible to set the prototype
to null.
|
|
We were leaking an empty value.
|
|
|
|
This rewrite drastically increases the accuracy of object literals.
Additionally, an "assertIsSyntaxError" function has been added to
test-common.js to assist in testing syntax errors.
|
|
|
|
Use the window progress escape sequence to indicate how far along in
the test collection we are while running tests. :^)
|
|
callback for Array.prototype.{reduce,reduceRight}
Arrow functions always retain the |this| binding.
Running this code in Node:
[1, 2].reduce(() => { "use strict"; console.log(this === undefined) }
Output: false
|
|
functions in Function.prototype.{call,apply}
|
|
Interpreter::call()
|
|
|
|
|
|
scope for arrow functions
|
|
|
|
The parser was chomping on commas present after the arrow function expression. eg. [x=>x,2] would parse as [x=>(x,2)] instead of [(x=>x),2].
This is not the case anymore. I've added a small test to prove this.
|