Age | Commit message (Collapse) | Author |
|
|
|
|
|
This new struct is now returned from get_own_property_descriptor. To
preserve the old functionality of returning an object, there is now a
get_own_property_descriptor_object method, for use in
{Object,Reflect}.getOwnPropertyDescriptor().
This change will be useful for the implementation of Proxies, which do a
lot of descriptor checks. We want to avoid as many object gets and puts
as possible.
|
|
When calling Object.defineProperty, there is now a difference between
omitting a descriptor attribute and specifying that it is false. For
example, "{}" and "{ configurable: false }" will have different
attribute values.
|
|
|
|
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.
|
|
|
|
|
|
parse_template_literal now breaks out of the loop if it sees something
it doesn't expect. Additionally, it now checks for EOFs.
|
|
This makes `typeof i_dont_exist` return `undefined` instead of
throwing an error.
|
|
|
|
Nothing fancy like line numbers, but Exception now stores a list of
function names up to the current call frame.
|
|
Having it globally on the interpreter is confusing as the last call frame
is skipped, which is specific to console.trace().
|
|
Having these duplicated is not really useful, either we want console
output to go somewhere then implementing a console client is the way to
go, or we don't care about console output - in that case we don't need
to dbg() either.
|
|
|
|
|
|
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.
|
|
|
|
When parsing JavaScript, we can get pretty much any sequnce of tokens,
and we shouldn't crash if it's not something that we normally expect.
Instead, emit syntax errors.
|
|
In C++, it's invalid to cast a block of memory to a complex type without
invoking its constructor. It's even more invalid to simply cast a pointer to a
block of memory to a pointer to *an abstract type*.
To fix this, make sure FreelistEntry is a concrete type, and call its
constructor whenever appropriate.
|
|
|
|
We cannot look at i+1'th character until we verify it's there.
|
|
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
|
|
functions
|
|
constructor
|
|
|
|
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.
|
|
|
|
The interpreter now considers a statement or block's label when
considering whether or not to break. All statements can be labelled.
|
|
|
|
All statements now have an optional label string that can be null.
|
|
|
|
As suggested in #2431's code review.
|
|
|
|
|
|
|
|
.. and make travis run it.
I renamed check-license-headers.sh to check-style.sh and expanded it so
that it now also checks for the presence of "#pragma once" in .h files.
It also checks the presence of a (single) blank line above and below the
"#pragma once" line.
I also added "#pragma once" to all the files that need it: even the ones
we are not check.
I also added/removed blank lines in order to make the script not fail.
I also ran clang-format on the files I modified.
|
|
This fixes the following from parsing incorrectly due to the comma
that occurs after the conditional:
let o = {
foo: true ? 1 : 2,
bar: 'baz',
};
|
|
|
|
Previously, the relational operators where casting any value to double
and comparing the results according to C++ semantics.
This patch makes the relational operators in JS behave according to the
standard specification.
Since we don't have BigInt yet, the implementation doesn't take it into
account.
Moved PreferredType from Object to Value. Value::to_primitive now
passes preferred_type to Object::to_primitive.
|