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

405 commits

Author SHA1 Message Date
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
Satya Rohith
fb094ae026
chore: bump crate version for 1.15.0 (#12406) 2021-10-12 22:16:15 +05:30
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
Feng Yu
668b400ff2
feat(runtime): improve error messages of runtime fs (#11984)
This commit annotates errors returned from FS Deno APIs to include
paths that were passed to the API calls.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-10-11 15:21:18 +02: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
Aaron O'Mullan
6b43e862fd
feat(runtime): allow passing extensions via Worker options (#12362) 2021-10-08 17:03:49 +02:00
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
Bert Belder
822047b845
fix(runtime): don't equate SIGINT to SIGKILL on Windows (#12356) 2021-10-07 16:31:02 +02:00
Aaron O'Mullan
678a881f63
refactor(runtime): Worker bootstrap options (#12299) 2021-10-05 22:41:14 +02:00
Leo K
77a00ce1fb
chore: various op cleanup (#12329) 2021-10-05 22:38:27 +02:00
Bartek Iwańczuk
d67e858506
chore: merge v1.14.3 into main (#12327) 2021-10-05 21:40:39 +02:00
Luca Casonato
64a7187238
chore: remove No*Permissions structs (#12316)
These are confusing. They say they are "for users that don't care about
permissions", but that isn't correct. `NoTimersPermissions` disables
permissions instead of enabling them.

I would argue that implementors should decide what permissions they want
themselves, and not take our opinionated permissions struct.
2021-10-04 22:56:24 +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
Andreu Botella
cdb252af0a
feat: support serializing WebAssembly.Module objects (#12140) 2021-09-29 10:47:24 +02:00
Luca Casonato
5b526e5d17
feat: stabilize URLPattern API (#12256) 2021-09-29 10:42:32 +02:00
Aaron O'Mullan
e8901281da
chore: bump crate versions for 1.14.2 (#12253) 2021-09-28 12:19:03 +02:00
Luca Casonato
ff3a17b72d
fix: subprocess kill support on windows (#12134) 2021-09-27 12:18:02 +02:00
Aaron O'Mullan
4e2b59f9df
cleanup(runtime): flatten op_kill's args (#12214) 2021-09-25 01:33:15 +02:00
Ryan Dahl
683a38e47c
refactor: Remove unused code (#12210) 2021-09-25 00:35:35 +02:00
Aaron O'Mullan
d0e14ae82c
chore(runtime): minor comment improvement (#12191) 2021-09-24 22:25:45 +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
faefe2300d
fix(cli/permissions): ensure revoked permissions are no longer granted (#12159)
Fixes #12153
2021-09-24 15:48:15 +10:00
Ryan Dahl
80a9a37df1
refactor: Remove depreated Worker::execute_module (#12203) 2021-09-23 21:46:22 -04:00
Aaron O'Mullan
a33ee087ce
perf(ops): optimize permission check (#11800)
* perf(ops): optimize permission check

Removes the overhead of permission check on access granted (should be common case):

Delta measured on `perf_now` from `deno_common` bench:
- before: `528ns/op
- after: `166ns/op`

So ~3x faster
2021-09-23 00:45:58 +02:00
Andreu Botella
5c5f4ea1d6
fix(workers): Don't panic when a worker's parent thread stops running (#12156)
This panic could happen in the following cases:

- A non-fatal error being thrown from a worker, that doesn't terminate
  the worker's execution, but propagates to the main thread without
  being handled, and makes the main thread terminate.
- A nested worker being alive while its parent worker gets terminated.
- A race condition if the main event loop terminates the worker as part
  of its last task, but the worker doesn't fully terminate before the
  main event loop stops running.

This panic happens because a worker's event loop should have pending ops
as long as the worker isn't closed or terminated – but if an event loop
finishes running while it has living workers, its associated
`WorkerThread` structs will be dropped, closing the channels that keep
those ops pending.

This change adds a `Drop` implementation to `WorkerThread`, which
terminates the worker without waiting for a response. This fixes the
panic, and makes it so nested workers are automatically terminated once
any of their ancestors is closed or terminated.

This change also refactors a worker's termination code into a
`WorkerThread::terminate()` method.

Closes #11342.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-09-22 18:02:15 +02:00
Kitson Kelly
2a56cd545c
chore: bump crate versions for 1.14.1 (#12172) 2021-09-22 06:53:47 +10:00
MikaelUrankar
8375f5464b
fix(runtime/ops/signal.rs): Add FreeBSD signal definitions (#12084) 2021-09-21 09:16:05 -04:00
Satya Rohith
923c5432e0
chore: bump deno_net (#12157) 2021-09-21 09:20:21 +05:30
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
Bartek Iwańczuk
f840906943
fix(core): prevent multiple main module loading (#12128)
This commit fixes a problem where loading and executing multiple 
modules leads to all of the having "import.meta.main" set to true.

Following Rust APIs were deprecated:
- deno_core::JsRuntime::load_module
- deno_runtime::Worker::execute_module
- deno_runtime::WebWorker::execute_module

Following Rust APIs were added:
- deno_core::JsRuntime::load_main_module
- deno_core::JsRuntime::load_side_module
- deno_runtime::Worker::execute_main_module
- deno_runtime::Worker::execute_side_module
- deno_runtime::WebWorker::execute_main_module

Trying to load multiple "main" modules into the runtime now results in an
error. If user needs to load additional "non-main" modules they should use
APIs for "side" module.
2021-09-18 03:44:53 +02:00
Squirrel
4b79e5a459
chore: Remove unused deps from Cargo.toml files (#12106) 2021-09-17 14:39:32 +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
David Sherret
16c27fce1f
chore: bump crate versions for 0.14 (#12072) 2021-09-14 15:38:35 -04:00
David Sherret
5e2c5d0afa
fix: permission prompt stuffing on Windows (#11969) 2021-09-14 08:37:27 -04: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
Ryan Dahl
13991e5995
refactor: Remove duplicated colors.rs file (#11990) 2021-09-12 12:04:17 -04: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
Yusuke Tanaka
87052927af
chore: upgrade Rust to 1.55.0 (#11965) 2021-09-09 21:15:21 -04:00
Ryan Dahl
fb35cd0ef4
fix: permission prompt stuffing (#11931)
Fixes #9750
2021-09-09 08:38:47 -04:00