0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-31 09:14:20 -04:00
Commit graph

592 commits

Author SHA1 Message Date
Colin Ihrig
3b1204eb2d
fix(core): make errors more resistant to tampering (#15789)
This commit makes error objects more resistant to
prototype tampering.

This bug was found when updating the deno_std Node compatibility
layer to Node 18. The Node test 'parallel/test-assert-fail.js'
was breaking std's assertion library.

Refs: https://github.com/denoland/deno_std/pull/2585
2022-09-07 09:11:16 -04:00
Divy Srivastava
d57f9d560d
fix(ext/flash): use utf8 length as Content-Length (#15793) 2022-09-07 16:21:30 +05:30
Divy Srivastava
d2a408f452
perf(runtime): short-circuit queue_async_op for Poll::Ready (#15773) 2022-09-06 23:08:37 +05:30
Garcia
4ec213b0aa
fix(ext/timers): create primordial eval (#15110) 2022-09-02 17:55:44 +02:00
Jason
8178665bd1
fix(cli/repl): await Promise.any([])... (#15623) 2022-09-02 13:38:06 +02:00
Geert-Jan Zwiers
58e76098e6
fix(serde_v8): no panic on reading large text file (#15494)
Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2022-09-01 22:20:11 +02:00
Divy Srivastava
20c835407c
fix(ext/flash): retry write failures (#15591) 2022-09-01 18:58:34 +05:30
Bartek Iwańczuk
da10c9c8d1
fix(ext/flash): panic on AddrInUse (#15607) 2022-08-26 08:42:11 +05:30
Bartek Iwańczuk
fb1c7b7dea
fix(unstable): finish HTTP response for 205 and 304 responses (#15584)
This commit fixes "Deno.serve()" API by making sure that
205 and 304 responses end with "\r\n\r\n".
2022-08-24 21:26:57 +02:00
Bartek Iwańczuk
a4cc09447e
fix(unstable): Deno.serve() can parse hostnames (#15579) 2022-08-24 16:38:51 +02:00
Luca Casonato
f3bde1d53b
feat(ext/flash): split upgradeHttp into two APIs (#15557)
This commit splits `Deno.upgradeHttp` into two different APIs, because
the same API is currently overloaded with two different functions. Flash
requests upgrade immediately, with no need to return a `Response`
object. Instead you have to manually write the response to the socket.
Hyper requests only upgrade once a `Response` object has been sent.

These two behaviours are now split into `Deno.upgradeHttp` and
`Deno.upgradeHttpRaw`. The latter is flash only. The former only
supports hyper requests at the moment, but can be updated to support
flash in the future.

Additionally this removes `void | Promise<void>` as valid return types
for the handler function. If one wants to use `Deno.upgradeHttpRaw`,
they will have to type cast the handler signature - the signature is
meant for the 99.99%, and should not be complicated for the 0.01% that
use `Deno.upgradeHttpRaw()`.
2022-08-24 17:40:57 +05:30
Luca Casonato
4ef08a58df
feat: update Deno.serve function signature (#15563)
This commit changes the `Deno.serve` function signature to be more
versatile and easier to use. It is now a drop in replacement for
std/http's `serve`.

The input validation has also been reworked.
2022-08-24 00:08:56 +02:00
Luca Casonato
24f7f3fda9
fix(ext/fetch): ignore user content-length header (#15555)
Previously if a user specified a content-length header for an POST
request without a body, the request would contain two `content-length`
headers. One added by us, and one added by the user.

This commit ignores all content-length headers coming from the user,
because we need to have the sole authority on the content-length because
we transmit the body.
2022-08-23 12:43:04 +02:00
Yoshiya Hinosawa
57d48134d1
fix(ext/flash): fix default onListen callback (#15533) 2022-08-22 17:01:43 +09:00
Bartek Iwańczuk
301f6c46ba
fix(unstable): better error for invalid hostname in Deno.serve() (#15529) 2022-08-21 21:15:52 +02:00
Yoshiya Hinosawa
fb2aeb79a1
fix(ext/flash): fix listening port (#15519) 2022-08-21 21:27:14 +09:00
Bartek Iwańczuk
5beec3f106
feat(unstable): change Deno.serve() API (#15498)
- Merge "Deno.serve()" and "Deno.serveTls()" API
- Remove first argument and use "fetch" field options instead
- Update type declarations
- Add more documentation
2022-08-19 14:36:01 +02:00
Divy Srivastava
8bdcec1c84
fix(ext/flash): concurrent response streams (#15493) 2022-08-19 10:14:56 +05:30
Divy Srivastava
cd21cff299
feat(ext/flash): An optimized http/1.1 server (#15405)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
Co-authored-by: crowlkats <crowlkats@toaxl.com>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2022-08-18 17:35:02 +05:30
Aapo Alasuutari
2164f6b1eb
perf(ops): Monomorphic sync op calls (#15337)
Welcome to better optimised op calls! Currently opSync is called with parameters of every type and count. This most definitely makes the call megamorphic. Additionally, it seems that spread params leads to V8 not being able to optimise the calls quite as well (apparently Fast Calls cannot be used with spread params).

Monomorphising op calls should lead to some improved performance. Now that unwrapping of sync ops results is done on Rust side, this is pretty simple:

```
opSync("op_foo", param1, param2);
// -> turns to
ops.op_foo(param1, param2);
```

This means sync op calls are now just directly calling the native binding function. When V8 Fast API Calls are enabled, this will enable those to be called on the optimised path.

Monomorphising async ops likely requires using callbacks and is left as an exercise to the reader.
2022-08-11 15:56:56 +02:00
diachedelic
2843160fc7
feat(ext/crypto): deriveBits P-384 (#15138)
This commit adds P-384 curve support for crypto.subtle.deriveBits.

Co-authored-by: James Diacono <james@diacono.com.au>
2022-07-23 22:34:37 +05:30
Bartek Iwańczuk
72199303d8
fix: Child.unref() unrefs stdio streams properly (#15275) 2022-07-22 18:07:20 +02:00
Bartek Iwańczuk
d17b3906bf
chore: use import.meta.resolve() in tests (#15256) 2022-07-20 16:56:53 +02:00
ayame113
27a72a12b7
chore: align some Web API type definitions to lib.dom.d.ts (#15219) 2022-07-20 18:30:41 +08:00
Phosra
b8e1250500
fix(ext/web): align DOMException better with spec (#15097) 2022-07-20 10:12:18 +02:00
Dante Issaias
2b1f145c3e
chore(ext): update webgpu (#15059) 2022-07-20 02:22:26 +02:00
Leo Kettmeir
2bebdc9116
feat(unstable): Ability to ref/unref "Child" in "Deno.spawnChild()" API (#15151)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
2022-07-18 22:24:35 +02:00
Nayeem Rahman
45c49034a7
BREAKING(unstable): Improve Deno.spawn() stdio API (#14919)
- "SpawnOutput" extends "ChildStatus" instead of composing it
- "SpawnOutput::stdout", "SpawnOutput::stderr", "Child::stdin", 
"Child::stdout" and "Child::stderr" are no longer optional, instead 
made them getters that throw at runtime if that stream wasn't set 
to "piped". 
- Remove the complicated "<T extends SpawnOptions = SpawnOptions>" 
which we currently need to give proper type hints for the availability of 
these fields. Their typings for these would get increasingly complex 
if it became dependent on more options (e.g. "SpawnOptions::pty" 
which if set should make the stdio streams unavailable)
2022-07-18 15:16:12 +02:00
David Sherret
5273259eef
chore: remove flaky writeSyncWhileAsyncFails test (#15194) 2022-07-13 15:49:20 -04:00
David Sherret
667812a297
fix(cli): synchronize async stdio/file reads and writes (#15092)
Fixes a regression where async writes and reads could get out of order.
2022-07-13 11:16:42 -04:00
Divy Srivastava
5b26a4a30e
fix(ext/http): reading headers with ongoing body reader (#15161) 2022-07-12 13:31:37 -04:00
Mark Ladyshau
6743b3227b
fix(ext/web): remove ErrorEventInit's error default (#14809) 2022-06-29 14:29:08 +02:00
Divy Srivastava
18c9a7ad64
fix(core): don't panic on non-existent cwd (#14957)
Co-authored-by: cjihrig <cjihrig@gmail.com>
2022-06-25 09:21:58 +05:30
Divy Srivastava
354fa6cd00
BREAKING(ext/ffi): Remove Deno.UnsafePointer indirection (#14915) 2022-06-20 19:08:10 +05:30
Mark Ladyshau
60869c2598
fix(ext/fetch): add accept-language default header to fetch (#14882) 2022-06-19 23:33:24 +02:00
Colin Ihrig
367e006e06
fix(ext/web): add EventTarget brand checking (#14637)
This commit adds brand checking to EventTarget. It also fixes a
bug where deno would crash if an abort signal was aborted on the
global addEventListener().
2022-06-17 11:05:02 -04:00
cjihrig
95312ab53a fix: make Performance global an EventTarget
This commit updates the Performance global to extend
EventTarget.
2022-06-16 12:05:33 -04:00
cjihrig
eadf943e59 fix(console): constrol inspect() indent with option (#14867)
This commit updates the Deno.inspect() logic to use the
indentLevel option to control indentation instead of passing
around separate indent/level parameters internally.

Refs: https://github.com/denoland/deno/issues/8099
Refs: https://github.com/denoland/deno/issues/14171
2022-06-15 09:52:28 -04:00
Luca Casonato
5bde4c7eca
BREAKING: remove Intl.v8BreakIterator (#14864)
This is a non-standard API that is mostly replaced by `Intl.Segmenter`.
2022-06-15 05:04:30 +02:00
David Sherret
4cff05b275
refactor(runtime/signal): revert SIGINT and SIGBREAK Deno.kill Windows changes (#14865) 2022-06-14 15:31:50 -04:00
Geert-Jan Zwiers
24571a3952
feat(runtime/signal): implement SIGINT and SIGBREAK for windows (#14694)
This commit adds support for SIGINT and SIGBREAK signals on 
Windows platform.

Co-authored-by: orange soeur <juzi201314@gmail.com>
2022-06-13 22:39:46 +02:00
Ryan Dahl
21dfeea3c4
Remove unstable Deno.sleepSync (#14719)
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-06-13 21:28:00 +02:00
Colin Ihrig
64abb65f05
feat(console): pass options and depth to custom inspects (#14855)
This commit updates Deno.inspect() to pass inspect options and
the current inspect depth to custom inspect functions.

Refs: https://github.com/denoland/deno/issues/8099
Refs: https://github.com/denoland/deno/issues/14171
2022-06-13 10:59:22 -04:00
diachedelic
ff5def9ed5
feat(ext/crypto): export elliptic keys as "raw" (#14764)
This commit adds support for the "raw" format when exporting public ECDH/ECDSA keys via
the SubtleCrypto.exportKey method.
2022-06-08 08:29:42 +05:30
Mark Ladyshau
4e26bcb2bb
fix(ext/crypto): adjust getRandomValues types (#14714) 2022-06-02 15:15:46 +02:00
James Bradlee
c41544ac7b
feat(unstable): add Deno.getGid (#14528) 2022-05-31 17:42:44 +09:00
Geert-Jan Zwiers
ab9c7f52e0
chore(serde_v8): throw error when string buffer exceeds v8 max length (#14588) 2022-05-26 17:15:44 +02:00
Bartek Iwańczuk
3aef7d1253
chore: upgrade test_util/std/ submodule (#14722) 2022-05-25 21:53:53 +02:00
Aaron O'Mullan
5e62ee31d7
fix(core): op metrics op_names mismatch (#14716) 2022-05-24 22:21:32 +02:00
Colin Ihrig
0a96cb62a8
fix(runtime): improve permission descriptor validation (#14676)
This commit improves the permission descriptor validation by
explicitly checking for object types and using optional
chaining when creating error messages in case the descriptor
is not an object.

Fixes: https://github.com/denoland/deno/issues/14675
2022-05-19 17:45:09 -04:00