Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
These are a part of the Annex B extension of the specification.
|
|
These are a part of the Annex B extension of the specification.
|
|
This is part of the Annex B extension of the specification.
|
|
This commit also brings charAt & charCodeAt closer to the specification
|
|
|
|
More specifically: cleanupSome, register & unregister.
FinalizationRegistery.prototype.cleanupSome is actually still a stage 2
proposal, but since test262 test cases already exist for it, i decided
to go for it :)
|
|
|
|
|
|
Also made recursive_array_flat more compliant with the spec
So renamed it to flatten_into_array
|
|
|
|
|
|
We were doing a *lot* of string-to-int conversion while creating a new
global object. This happened because Object::put() would try to convert
the property name (string) to an integer to see if it refers to an
indexed property.
Sidestep this issue by using PropertyName for the CommonPropertyNames
struct on VM (vm.names.foo), and giving PropertyName a flag that tells
us whether it's a string that *may be* a number.
All CommonPropertyNames are set up so they are known to not be numbers.
|
|
|
|
|
|
|
|
Currently stage 3. https://github.com/tc39/proposal-error-cause
|
|
|
|
|
|
Specifically all aside from "values" and "entries" which require an
implementation of the SetIterator object.
|
|
|
|
|
|
These are a bit hacky, since they are supposed to be separate methods,
but since serenity only supports UTC currently, they are equivalent.
|
|
|
|
|
|
|
|
We only support UTC currently, so this always returns 0 as long as the
date is not invalid.
|
|
|
|
|
|
These are the same as trim{Start, End} respectively.
|
|
Adds an implementation of the following StringPrototype methods:
anchor, big, blink, bold, fixed, fontcolor, fontsize, italics, link,
small, strike, sub, sup.
|
|
|
|
|
|
|
|
This is currently a TC39 Stage 2 proposal, but let's go for it!
https://github.com/tc39/proposal-accessible-object-hasownproperty
I wrote the C++, @linusg found bugs and wrote the test.
|
|
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
|
|
|
|
These are generally useful and in particular needed for twitter.com
|
|
|
|
|
|
|
|
|
|
Almost a year after first working on this, it's finally done: an
implementation of Promises for LibJS! :^)
The core functionality is working and closely following the spec [1].
I mostly took the pseudo code and transformed it into C++ - if you read
and understand it, you will know how the spec implements Promises; and
if you read the spec first, the code will look very familiar.
Implemented functions are:
- Promise() constructor
- Promise.prototype.then()
- Promise.prototype.catch()
- Promise.prototype.finally()
- Promise.resolve()
- Promise.reject()
For the tests I added a new function to test-js's global object,
runQueuedPromiseJobs(), which calls vm.run_queued_promise_jobs().
By design, queued jobs normally only run after the script was fully
executed, making it improssible to test handlers in individual test()
calls by default [2].
Subsequent commits include integrations into LibWeb and js(1) -
pretty-printing, running queued promise jobs when necessary.
This has an unusual amount of dbgln() statements, all hidden behind the
PROMISE_DEBUG flag - I'm leaving them in for now as they've been very
useful while debugging this, things can get quite complex with so many
asynchronously executed functions.
I've not extensively explored use of these APIs for promise-based
functionality in LibWeb (fetch(), Notification.requestPermission()
etc.), but we'll get there in due time.
[1]: https://tc39.es/ecma262/#sec-promise-objects
[2]: https://tc39.es/ecma262/#sec-jobs-and-job-queues
|
|
toGMTString() is deprecated but is kept for compatibility's sake, but because
HTTP Dates are always expressed in GMT, it should be safe to call toUTCString()
in toGMTString().
|
|
|
|
arguments.callee refers to the currently executing function.
|
|
|
|
|