1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-01 09:24:20 -04:00
Commit graph

179 commits

Author SHA1 Message Date
Yoshiya Hinosawa
a9b34118a9
feat(runtime): add Deno.addSignalListener API (#12512) 2021-10-26 12:03:38 +09:00
Nayeem Rahman
7a22df9b76
fix(runtime/ops/worker_host): move permission arg parsing to Rust (#12297) 2021-10-13 13:04:44 -04:00
David Sherret
d5a7a6d575
chore: fix flaky steps_invalid_usage tests (#12422) 2021-10-13 08:55:12 -04:00
David Sherret
9b1f0c8ba3
chore: upgrade crates based on deno ast 0.3 (#12403) 2021-10-12 09:58:04 -04:00
Andreu Botella
fbcbbd7ae3
fix(runtime): Declare Window.self and DedicatedWorkerGlobalScope.name with util.writable() (#12378)
`Window`'s `self` property and `DedicatedWorkerGlobalScope`'s `name`
property are defined as Web IDL read-only attributes with the
`[Replaceable]` extended attribute, meaning that their setter will
redefine the property as a data property with the set value, rather than
changing some internal state. Deno currently defines them as read-only
data properties instead.

Given that Web IDL requires all attributes to be accessor properties
rather than data properties, but Deno exposes almost all of those
properties as either read-only or writable data properties, it makes
sense to expose `[Replaceable]` properties as writable as well – as is
already the case with `WindowOrWorkerGlobalScope`'s `performance`
property.
2021-10-11 18:50:18 +02:00
Casper Beyer
1683044ed9
feat: provide ops details for ops sanitizer failures (#12188) 2021-10-11 17:00:33 +02:00
David Sherret
426ebf854a
feat(unstable/test): imperative test steps API (#12190) 2021-10-11 09:45:02 -04:00
Aaron O'Mullan
5a8a989b78
refactor(metrics): move to core (#12386)
Avoids overhead of wrapping ops (and allocs when inspecting async-op futures)
2021-10-10 17:20:30 +02:00
Ryan Dahl
6ac0337165
feat: Stabilize Deno.kill and Deno.Process.kill (#12375)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-10-10 15:48:26 +02:00
Satya Rohith
29f9e14457
feat: stabilize Deno.resolveDns (#12368) 2021-10-10 15:46:11 +05:30
Andreu Botella
74e5b68682
refactor: deduplicate defineEventHandler util (#12367) 2021-10-08 09:53:31 +02:00
Andreu Botella
e8b3ffd155
fix(runtime): Getting navigator.hardwareConcurrency on workers shouldn't throw (#12354) 2021-10-07 19:39:33 +02:00
Leo K
77a00ce1fb
chore: various op cleanup (#12329) 2021-10-05 22:38:27 +02:00
Nayeem Rahman
b354eaa247
fix(runtime/js/workers): throw errors instead of using an op (#12249) 2021-10-01 11:30:55 +02:00
Casper Beyer
6bf5c850e6
fix(runtime/testing): format aggregate errors (#12183) 2021-09-30 21:54:56 +02:00
David Sherret
c3e441c5b5
fix: worker environment permissions should accept an array (#12250) 2021-09-30 15:50:59 -04:00
Luca Casonato
5b526e5d17
feat: stabilize URLPattern API (#12256) 2021-09-29 10:42:32 +02:00
Aaron O'Mullan
4e2b59f9df
cleanup(runtime): flatten op_kill's args (#12214) 2021-09-25 01:33:15 +02:00
李瑞丰
46245b830a
fix(ext/webidl): correctly apply [SymbolToStringTag] to interfaces (#11851)
Co-authored-by: Luca Casonato <hello@lcas.dev>
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2021-09-25 02:07:22 +09:00
Nayeem Rahman
75ca013f07
fix(cli/fmt_errors): Abbreviate long data URLs in stack traces (#12127)
Co-authored-by: Mike White <mike.white@auctane.com>
2021-09-18 15:40:04 +02:00
Aaron O'Mullan
00948a6d68
perf(runtime/fs): optimize readFile by using a single large buffer (#12057)
* perf(runtime/fs): optimize readFile by using a single large buffer
* handle extended/truncated files during read

Allocate an extra byte in our read buffer to detect "overflow" then fallback to unsized readAll for remainder of extended file, this is a slowpath that should rarely happen in practice
2021-09-16 20:28:15 +02:00
Divy Srivastava
868f38d452
fix(ext/crypto): use DataError in importKey() (#12071) 2021-09-16 09:58:29 +02:00
Leo K
a655a0f3e4
feat(unstable): allow specifing gid and uid for subprocess (#11586) 2021-09-13 19:26:23 +02:00
Bartek Iwańczuk
a95ca9dc70
feat: stabilise Deno.upgradeWebSocket (#12024) 2021-09-13 14:06:12 +02:00
Andreu Botella
676565c711
refactor(runtime): Use util.nonEnumerable to define console (#11982)
A comment in `runtime.js` reads that `console` seems to be "the only one
that should be writable and non-enumerable", which explains why it is
declared with `util.writable` but then has its property descriptor's
`enumerable` key changed to false.

But it is not in fact true that `console` is the only global property
for which this holds, and it wasn't even when this behavior was
introduced in denoland#9013. All WebIDL interfaces are also writable and
non-enumerable – the only difference here being that `console` is a
namespace rather than an interface.

Since WebIDL interfaces are defined with `util.nonEnumerable`, and
`console` uses the same descriptor keys, this PR changes the definition
of `console` to use `util.nonEnumerable` as well.
2021-09-12 00:20:30 +02:00
Luca Casonato
e07f28d301
feat: add URLPattern API (#11941)
This adds support for the URLPattern  API.

The API is added in --unstable only, as it has not yet shipped in any
browser. It is targeted for shipping in Chrome 95.

Spec: https://wicg.github.io/urlpattern/

Co-authored-by: crowlKats < crowlkats@toaxl.com >
2021-09-08 11:14:29 +02:00
Bartek Iwańczuk
a5bcf7033e
chore: add better error message for signal API on Windows (#11935) 2021-09-07 13:17:44 +02:00
Ryan Dahl
c132c8690b
BREAKING(unstable): Remove Deno.Signals enum, Deno.signals.* (#11909) 2021-09-06 10:05:33 -04:00
Andreu Botella
b7c2902c97
Don't drop messages from workers that have already been closed (#11913)
When `worker.terminate()` is called, the spec requires that the
corresponding port message queue is emptied, so no messages can be
received after the call, even if they were sent from the worker before
it was terminated.

The spec doesn't require this of `self.close()`, and since Deno uses
different channels to send messages and to notify that the worker was
closed, messages might still arrive after the worker is known to be
closed, which are currently being dropped. This change fixes that.

The fix involves two parts: one on the JS side and one on the Rust side.
The JS side was using the `#terminated` flag to keep track of whether
the worker is known to be closed, without distinguishing whether further
messages should be dropped or not. This PR changes that flag to an
enum `#state`, which can be one of `"RUNNING"`, `"CLOSED"` or
`"TERMINATED"`.

The Rust side was removing the `WorkerThread` struct from the workers
table when a close control was received, regardless of whether there
were any messages left to read, which made any subsequent calls to
`op_host_recv_message` to return `Ok(None)`, as if there were no more
mesasges. This change instead waits for both a close control and for
the message channel's sender to be closed before the worker thread is
removed from the table.
2021-09-06 11:05:02 +02:00
Casper Beyer
01bfb7d913
refactor(testing): use discrete report functions (#11917) 2021-09-05 22:42:35 +02:00
Casper Beyer
ce79cb5797
refactor(testing): redirect console output via reporter (#11911)
This feeds console output to the reporter and handles silencing there
instead of in the JavaScript code.
2021-09-04 15:16:35 +02:00
David Sherret
987716798f
feat(fmt): add basic JS doc formatting (#11902) 2021-09-02 18:28:12 -04:00
Andreu Botella
c49eee551f
feat(workers): Make the Deno namespace configurable and unfrozen (#11888)
This is the worker counterpart of PR #11062.
2021-08-31 19:33:03 +02:00
Luca Casonato
5d814a4c24
feat: ArrayBuffer in structured clone transfer (#11840) 2021-08-25 13:48:53 +02:00
Tilman Roeder
93d83a84db
feat(unstable): Add file locking APIs (#11746)
This commit adds following unstable APIs:
- Deno.flock()
- Deno.flockSync()
- Deno.funlock()
- Deno.funlockSync()
2021-08-24 15:21:31 +02:00
Yusuke Tanaka
4ae57d185e
chore: upgrade dlint and run prefer-primordials rule (#11777) 2021-08-20 01:14:20 +02:00
Andreu Botella
ddbb7b83f2
feat(runtime): support classic workers for internal testing (#11338)
This commit implements classic workers, but only when the `--enable-testing-features-do-not-use` flag is provided. This change is not user facing. Classic workers are used extensively in WPT tests. The classic workers do not support loading from disk, and do not support TypeScript.

Co-authored-by: Luca Casonato <hello@lcas.dev>
2021-08-16 14:29:54 +02:00
Leo K
2db381eba9
feat: add experimental WebSocketStream API (#10365)
This commit adds the experimental WebSocketStream API when
using the --unstable flag.

The explainer for the API can be found here:
https://github.com/ricea/websocketstream-explainer
2021-08-10 00:28:17 +02:00
Leo K
16ae4a0d57
feat(extensions/web): add structuredClone function (#11572)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2021-08-09 10:39:00 +02:00
Elias Sjögreen
33c8d790c3
feat: ffi to replace plugins (#11152)
This commit removes implementation of "native plugins" and replaces
it with FFI API.

Effectively "Deno.openPlugin" API was replaced with "Deno.dlopen" API.
2021-08-06 23:28:10 +02:00
Bartek Iwańczuk
0d1a522a03
revert: allow URL for permissions (#11600)
Revert changes to "net" permissions in regards to handling URLs 
introduced in 15b0e61de.
2021-08-06 21:10:04 +02:00
Benjamin Gruenbaum
2b53602d3c
feat: support AbortSignal in writeFile (#11568) 2021-08-06 10:21:29 -07:00
Leo K
15b0e61de5
feat(runtime): allow URL for permissions (#11578) 2021-08-06 15:04:00 +02:00
Leo K
2ac031d6fd
feat(unstable): clean environmental variables for subprocess (#11571)
This commit adds "Deno.RunOptions.clearEnv" option, that allows
to clear environmental variables from parent process before spawning
a subprocess.
2021-08-04 21:47:43 +02:00
Bartek Iwańczuk
3a2e94492b
feat: stabilize Deno.serveHttp() (#11544)
This commit moves "Deno.serveHttp()" and related types
to stable namespace.
2021-08-02 14:40:46 +02:00
Divy Srivastava
2b13bb6945
feat(runtime): implement navigator.hardwareConcurrency (#11448)
This commit implements "navigator.hardwareConcurrency" API, which
supersedes "Deno.systemCpuInfo()" API (which was removed in this commit).
2021-07-29 21:45:11 +02:00
Yusuke Tanaka
865d9ddd51
refactor: use primordials in runtime, extensions and core (#11500) 2021-07-26 13:52:59 +02:00
Aaron O'Mullan
3e08b6ae89
cleanup(runtime): remove last references to Deno.core.sharedQueue (#11503)
`Deno.core.sharedQueue` was killed in #9843
2021-07-23 10:53:51 -07:00
Casper Beyer
69ca44d8e2
refactor(cli/tools/test_runner): split reporter into distinct stages (#11395)
This splits up the reporter into smaller functions, one for each
distinct event that happens during the testing process.
2021-07-14 21:05:16 +02:00
Casper Beyer
9cb48bd8fe
refactor(runtime): apply permissions as a hook during registration (#11347) 2021-07-14 00:11:02 +02:00