Commit graph

54 commits

Author SHA1 Message Date
Saúl Ibarra Corretgé
99a7fbb276 Set version to 0.4.1 2024-03-11 11:16:31 +01:00
Saúl Ibarra Corretgé
125373836d Now working on 0.5.0 2024-03-11 11:01:45 +01:00
Saúl Ibarra Corretgé
434fecda17 Set version to 0.4.0 2024-03-11 11:01:00 +01:00
Tyler Rockwood
ec4f957ca1
Add methods to detect arrays (#282)
I have a use case where a user can hand me many different kinds of
types, array buffer, uint8array, or a string, and I need to be able to
distingush between them.

Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
2024-02-28 12:17:18 +01:00
Tyler Rockwood
377e6a6c06 Fix JS_INVALID_PROMISE_STATE macro 2024-02-26 18:37:30 +01:00
Tyler Rockwood
d168361207 Add documentation for promise APIs
Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
2024-02-23 19:49:52 +01:00
Tyler Rockwood
33f72491a9
Add method to GetClassID (#275)
* Add method to GetClassID

If you want to extend a built-in class you need it's class ID and there
is no robust way to get that without this accessor.

Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>

* introduce constant for invalid class ID

Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>

---------

Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
2024-02-20 09:29:08 +01:00
Saúl Ibarra Corretgé
fb03ca24d2 Add WASI support 2024-02-14 08:59:15 +01:00
Saúl Ibarra Corretgé
7ded62c536 Align module export API with upstream
Partially reverts
6868fb9e25
but the same behavior can be implemented in userland by getting the
module ns and querying its properties.

Ref: c6cc6a9a5e
Fixes: https://github.com/quickjs-ng/quickjs/issues/259
2024-02-12 11:00:31 +01:00
Guilherme Bernal
6868fb9e25 feat: Added functions to get access to module exports 2024-01-18 18:42:37 +01:00
Ben Noordhuis
b5d6cea20e
Fix Reflect typed array element conversion (#240) 2023-12-30 10:45:33 +01:00
Saúl Ibarra Corretgé
d1852b5ea2 Remove unnecessary casts
Follow-up to https://github.com/quickjs-ng/quickjs/pull/195
2023-12-20 09:02:28 +01:00
Saúl Ibarra Corretgé
c29ae8d08c Now working on 0.4.0 2023-12-19 22:58:20 +01:00
Saúl Ibarra Corretgé
2d0b6d8ade Set version to 0.3.0 2023-12-19 22:46:31 +01:00
Ben Noordhuis
ba8b80f112
Remove broken JS_READ_OBJ_ROM_DATA flag (#216)
This JS_ReadObject() flag no longer works for bytecode. The IC opcodes
are patched during execution.

Fixes: https://github.com/quickjs-ng/quickjs/issues/206
Refs: https://github.com/quickjs-ng/quickjs/pull/120
2023-12-14 15:25:29 +01:00
Ben Noordhuis
8baafc46bd
Don't throw OOB exception for detached typed array (#208)
`a[42] = 1` where a is a detached typed array should not throw but
`Object.defineProperty()` still should. Add a check and a flag that
distinguishes between the two cases.
2023-12-12 23:14:33 +01:00
Ben Noordhuis
f1b7b6da71
Replace JSValueConst with JSValue (#195)
JSValueConst was only used for the now removed CONFIG_CHECK_JSVALUE
build mode. It is kept around as an alias for JSValue in quickjs.h to
avoid breaking everyone's source builds but remove it everywhere else.
2023-12-10 15:15:42 +01:00
Ben Noordhuis
4d57997ee7
Remove CONFIG_CHECK_JSVALUE build mode (#194)
It doesn't produce a working build and I'm somewhat skeptical that
its purported goal of catching reference counting bugs still works.
2023-12-10 13:50:26 +01:00
Saúl Ibarra Corretgé
2d05150e35 Now working on 0.3.0 2023-12-05 23:27:23 +01:00
Saúl Ibarra Corretgé
a393ebc2f8 Set version to 0.2.0 2023-12-05 23:18:22 +01:00
Ben Noordhuis
087441559e Replace JS_NewFloat64() calls with js_float64() 2023-11-29 23:38:01 +01:00
Ben Noordhuis
a6e73ca73c
Handle serialization endianness transparently (#152)
Change JS_WriteObject() and JS_WriteObject2() to write little-endian
data and update JS_ReadObject() to byte-swap data when running on a
big-endian system.

Obsoletes the JS_WRITE_OBJ_BSWAP flag, it is now a no-op.

Fixes: https://github.com/quickjs-ng/quickjs/issues/125
2023-11-28 22:49:01 +01:00
Saúl Ibarra Corretgé
5c136edbcf Implement WeakRef 2023-11-28 13:26:33 +01:00
Saúl Ibarra Corretgé
fb1b1ced26
Set default visibility to hidden and export the public API (#140) 2023-11-26 01:41:32 +01:00
Saúl Ibarra Corretgé
d74b2e7ec1 Squelch a -Wcast-function-type warnings
Ref: https://github.com/quickjs-ng/quickjs/issues/131
2023-11-26 00:08:48 +01:00
Saúl Ibarra Corretgé
8f2993bd68 Add APIs to build a Uint8Array from binary data directly 2023-11-24 23:05:39 +01:00
Saúl Ibarra Corretgé
268cde8270 Add API to build Date objects 2023-11-24 23:05:27 +01:00
Saúl Ibarra Corretgé
4e73bcf42d
Now working on version 0.2.0 2023-11-23 15:46:00 +01:00
Saúl Ibarra Corretgé
fd3d71b486
Set version 0.1.0 2023-11-23 14:44:54 +01:00
Saúl Ibarra Corretgé
5ce2957e23 Make JS_NewClassID thread aware
It's as thread-safe as JSRuntime, which isn't thread-safe, but multiple
threads can now allocate them on different runtimes without a problem.
2023-11-21 07:02:34 +01:00
Saúl Ibarra Corretgé
a721bda7b5 Drop CONFIG_ALL_UNICODE and enable it by default 2023-11-20 10:52:04 +01:00
Saúl Ibarra Corretgé
ea068d9a70 Add performance.{now,timeOrigin}
Ref: https://github.com/quickjs-ng/quickjs/issues/16
2023-11-18 11:16:35 +01:00
Saúl Ibarra Corretgé
e0170867b4 Set dev as the current version suffix 2023-11-16 09:24:43 +01:00
Saúl Ibarra Corretgé
cc3e062484 Simplify NAN boxing macro setting 2023-11-14 21:57:24 +01:00
Ben Noordhuis
920cfc679a
Add copyright notices (#51)
I believe we made enough substantial changes to have a credible claim to
copyright holdership.
2023-11-12 22:42:07 +01:00
Ben Noordhuis
162a8b7409
Remove trailing whitespace (#46)
Not purely cosmetic because it breaks navigation with { and } in the
One True Editor.
2023-11-12 10:01:40 +01:00
Saúl Ibarra Corretgé
55e845c5dd Add JS_GetVersion 2023-11-10 16:48:49 +01:00
Ole André Vadla Ravnås
3c144fd553 Add JS_GetAnyOpaque() to support polymorphism
To be able to check if the class ID is one of multiple known ones, where
the data has a common structure.
2023-11-10 11:01:22 +01:00
Ben Noordhuis
ae17b8522d
Remove operator overloading (#32)
Part of https://github.com/quickjs-ng/quickjs/issues/17
2023-11-10 10:23:40 +01:00
Ben Noordhuis
e449cb08ef
Remove BigFloat (#31)
Part of https://github.com/quickjs-ng/quickjs/issues/17
2023-11-08 22:23:06 +01:00
Saúl Ibarra Corretgé
c1ed688610 Drop non-standard JSON extension
Ref: https://github.com/quickjs-ng/quickjs/issues/20
2023-11-08 22:14:25 +01:00
Ben Noordhuis
5d5b3cc21f
Remove BigDecimal (#29)
Part of https://github.com/quickjs-ng/quickjs/issues/17
2023-11-08 21:07:16 +01:00
Ben Noordhuis
0068db8a11 Avoid UB when checking if float fits in int32 2023-11-08 19:17:13 +01:00
Saúl Ibarra Corretgé
e2ae8746ca
Drop support for "use strip"
Ref: https://github.com/quickjs-ng/quickjs/issues/20
2023-11-07 00:29:11 +01:00
Saúl Ibarra Corretgé
6d7fd42aae Add JS_GetUint8Array API
Shorthand for getting the underlying buffer of a Uint8Array.
2023-11-01 23:06:31 +01:00
Saúl Ibarra Corretgé
a9ac7a07ff Add top-level await support
Original author: zamfofex <zamfofex@twdb.moe>
2023-11-01 22:42:59 +01:00
bellard
b5e62895c6 2021-03-27 release 2021-03-27 11:17:31 +01:00
bellard
b1f67dfc1a 2020-11-08 release 2020-11-08 14:30:56 +01:00
bellard
7c312df422 2020-09-06 release 2020-09-06 19:10:15 +02:00
bellard
8900766099 2020-07-05 release 2020-09-06 19:07:30 +02:00