Commit graph

7 commits

Author SHA1 Message Date
Linus Groh
0718f216af LibJS: Add assertThrowsError() test function 2020-04-20 11:38:01 +02:00
Brian Gianforcaro
d74ad81402 js/LibJS: Move test functions to pure javascript.
The addition of assert functions to Userland/js
was done before we had load(..) implemented. Now
that it exists, it seems like the right move the
test helper functions to pure javascript instead
of poluting js with random global functions.
2020-04-14 12:55:31 +02:00
Linus Groh
b9415dc0e9 LibJS: Use assertNotReached() in tests 2020-04-13 16:28:50 +02:00
4ourbit
02c9f4c951
LibJS: Improve Object.defineProperty test 2020-04-10 23:33:02 +02:00
Linus Groh
7636dee2cb LibJS: Remove assert function from Object.defineProperty() test 2020-04-10 16:37:04 +02:00
Andreas Kling
8286f8b996 LibJS: Add property configuration transitions
Object.defineProperty() can now change the attributes of a property
already on the object. Internally this becomes a shape transition with
the TransitionType::Configure. Such transitions don't expand the
property storage capacity, but rather simply keep attributes up to date
when generating a property table.
2020-04-10 00:36:06 +02:00
Andreas Kling
e6d920d87d LibJS: Add Object.defineProperty() and start caring about attributes
We now care (a little bit) about the "configurable" and "writable"
property attributes.

Property attributes are stored together with the property name in
the Shape object. Forward transitions are not attribute-savvy and will
cause poor Shape reuse in the case of multiple same-name properties
with different attributes.

Oh, and this patch also adds Object.getOwnPropertyDescriptor() :^)
2020-04-10 00:36:06 +02:00