Commit graph

149 commits

Author SHA1 Message Date
Saúl Ibarra Corretgé
0b920e7411 Fix make debug 2023-11-27 23:53:41 +01:00
Ben Noordhuis
8be0358dd7
Ignore testdir config when -d or -f is passed (#145)
Otherwise it runs the whole test262 suite even though I just want to run
a select few.
2023-11-27 00:59:30 +01:00
Ben Noordhuis
b5148b212e
Implement static class initializer blocks (#144)
Spec compliance bug: "await" is illegal inside initializer blocks
_except_ when used as an identifier in a function expression, like so:

    class C {
        static {
            var f = function await() {}
        }
    }

It is somewhat complicated to make the parser understand the distinction
and such code is probably rare or non-existent so I decided to leave
well enough alone for now.
2023-11-26 21:11:48 +01:00
Ben Noordhuis
51633afe56
Remove no-op OP_swap+OP_swap bytecode sequence (#143)
Observed in generated code for static initializers. We could in theory
track and correct it in js_parse_class() but doing it as a peephole
optimization is both easier and more general.
2023-11-26 16:54:43 +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
Ben Noordhuis
8df335a7b9
Expose class name to static initializers (#139)
Fixes: https://github.com/quickjs-ng/quickjs/issues/138
2023-11-26 01:09:18 +01:00
Saúl Ibarra Corretgé
d4c1244045 Ignore -Wimplicit-fallthrough 2023-11-26 00:08:48 +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é
7776cc3b75 Fix getting array buffer when building Uint8Array 2023-11-25 00:42:44 +01:00
Saúl Ibarra Corretgé
27287519aa Fix implicit enum conversion
Ref: https://github.com/quickjs-ng/quickjs/issues/131
2023-11-25 00:00:45 +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é
0bbb78ce5e Fix not making library include path public
This broke embedding the qjs library via CMake.
2023-11-24 23:05:12 +01:00
Fedor Indutny
ff5e8dc3f5 Fix repl autocompletion for regexp with flags
Fix: #74
2023-11-24 20:57:03 +01:00
Saúl Ibarra Corretgé
463df3adf6 Simplify code in CI 2023-11-24 15:44:35 +01:00
Saúl Ibarra Corretgé
72e542fbeb Add MinGW 32 CI target 2023-11-24 15:44:35 +01:00
Ben Noordhuis
22a3d80740 Implement Map.groupBy 2023-11-24 11:30:21 +01:00
Ben Noordhuis
3e54403b08 Implement Object.groupBy 2023-11-24 11:30:21 +01:00
Ben Noordhuis
52f7524932 Enable array-grouping test262 feature 2023-11-24 11:30:21 +01:00
Divy Srivastava
a8a5ecb095
Specialize bytecode for default ctor (#112) 2023-11-24 01:27:18 +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é
af456e6c11 Add workflow for making releases 2023-11-23 14:43:56 +01:00
Saúl Ibarra Corretgé
5e4d45a9d4 Add -ng suffix to CLI output 2023-11-23 00:07:26 +01:00
Saúl Ibarra Corretgé
1dcb61b521 CMake: dynamically detect compiler options 2023-11-22 19:33:59 +01:00
Saúl Ibarra Corretgé
d88b6734e9 Make MinGW builds fully statically linked
Note the pthread usage is due to the Worker support, which is gated out
on Windows so there should be no need to link with pthreads on MinGW.
2023-11-22 19:25:37 +01:00
Ben Noordhuis
5573681986 Remove outdated comment from test262.conf 2023-11-22 00:29:02 +01:00
Ben Noordhuis
165128257f
Fix AsyncGenerator.prototype.return error handling (#109)
A poisoned .constructor property is observable and the resulting
exception should be delivered to the catch handler, not silently
dropped, otherwise the generator hangs.
2023-11-21 23:57:10 +01:00
Saúl Ibarra Corretgé
8d496b3e3c Add queueMicrotask
Ref: https://github.com/quickjs-ng/quickjs/issues/16
2023-11-21 23:43:17 +01:00
Divy Srivastava
1fcb573e6b
Implement ArrayBuffer.prototype.transfer (#101) 2023-11-21 19:29:23 +01:00
Ben Noordhuis
9e8d278161
Use ReferenceError from right realm/context (#107)
The "this is not initialized" ReferenceError for a class C defined in
context B but instantiated in context A should be an instance of the
ReferenceError from A, not B.
2023-11-21 19:24:15 +01:00
Ben Noordhuis
7c9cf46f97
Make Date methods argument coercion spec compliant (#104) 2023-11-21 15:04:38 +01:00
Divy Srivastava
7aabea9db0
Implement Error causes (#103) 2023-11-21 14:59:26 +01:00
Ben Noordhuis
d8ea7df950
Reject date strings with negative year zero (#100) 2023-11-21 11:43:45 +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
Ben Noordhuis
b56a82d19f
Normalize inputs to String.prototype.localeCompare (#97)
NFC-normalize the inputs, otherwise strings like "Å" and "A\u030A"
(latin A with combining diacritical mark) don't compare equal.
2023-11-21 00:00:54 +01:00
Saúl Ibarra Corretgé
a721bda7b5 Drop CONFIG_ALL_UNICODE and enable it by default 2023-11-20 10:52:04 +01:00
Ben Noordhuis
bef2a12566
DRY surrogate pair handling (#95) 2023-11-20 09:46:02 +01:00
Ben Noordhuis
d1960d1bfe
Implement RegExp 'd' flag (#86) 2023-11-20 09:45:44 +01:00
Ben Noordhuis
e2bc6441f8
Optimize RegExp ASCII literal matching (#94)
Add REOP_char8 that matches single bytes. Compresses bytecode for the
ASCII common case by 33% and reduces regexp_ascii benchmark running time
by 4%. The regexp_utf16 benchmark is unaffected.
2023-11-19 17:26:45 +01:00
Ben Noordhuis
e49da8e96f
Unbreak microbench, add os.now() (#93)
The removal of the high-precision but non-standard clock source in
commit 5af98ca broke microbench because Date.now() is not granular
enough for the benchmark runner to make forward progress.

This commit adds a new method to the os module that returns time
with microsecond precision.
2023-11-19 17:26:25 +01:00
Ben Noordhuis
4727e40ac8
Retrieve RegExp 'g' flag in spec conformant way (#92) 2023-11-19 17:26:03 +01:00
Ben Noordhuis
b56cbb143c
Implement extended named capture group identifiers (#90)
Perfectly reasonable and not at all uncommon regular expressions like
/(?<𝑓𝑜𝑥>fox).*(?<𝓓𝓸𝓰>dog)/ are now accepted.
2023-11-19 11:01:38 +01:00
Ben Noordhuis
20b3aca5a2
Update to Unicode 15.0.0 (#89) 2023-11-18 22:29:53 +01:00
Ben Noordhuis
5af98ca858
Remove non-standard Date.__date_clock method (#88) 2023-11-18 19:15:05 +01:00
Ben Noordhuis
8ba4f4b824
Remove dead code (#87) 2023-11-18 19:14:24 +01:00
Divy Srivastava
5d2e74fbbd Add -DBUILD_QJS_LIBC option 2023-11-18 12:34:59 +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é
f03ab48a85 Drop "LTO mode" from qjsc 2023-11-18 00:31:31 +01:00
Saúl Ibarra Corretgé
bebdfcea48
Drop ability to generate executables from qjsc (#76)
It's too brittle, and compiling the result is one command away.
2023-11-17 23:56:22 +01:00