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

3395 commits

Author SHA1 Message Date
Andreu Botella
01a6b66034
feat: support abort reasons in Deno APIs and WebSocketStream (#13066) 2021-12-16 12:57:26 +01:00
Nayeem Rahman
9ffc7edc23
refactor(cli): use GraphData for check and emit (#12960) 2021-12-16 21:45:41 +11:00
Kitson Kelly
e28fb70aee
fix(lsp): provide diagnostics for import assertions (#13105)
Fixes: #13099
2021-12-16 14:53:17 +11:00
Jesper van den Ende
0f53b82cd2
fix(test): wait for inspector session in side modules (#13065)
This commit fixes inspector integration with "deno test" subcommand
by waiting for inspector sessions to connect if "--inspect-brk" flag
is passed.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-12-16 00:38:27 +01:00
Jesper van den Ende
5a3ded6611
feat(watch): support watching external files (#13087) 2021-12-15 16:04:43 -05:00
Bartek Iwańczuk
d8e7e3fbe3
chore: update cli/Cargo.toml (#13096) 2021-12-15 20:57:43 +01:00
David Sherret
6c324acf23
feat: REPL import specifier auto-completions (#13078) 2021-12-15 13:23:43 -05:00
Bartek Iwańczuk
a1f0796fcc
feat: Add support for import assertions and JSON modules (#12866)
This commit adds proper support for import assertions and JSON modules.

Implementation of "core/modules.rs" was changed to account for multiple possible
module types, instead of always assuming that the code is an "ES module". In
effect "ModuleMap" now has knowledge about each modules' type (stored via
"ModuleType" enum). Module loading pipeline now stores information about
expected module type for each request and validates that expected type matches
discovered module type based on file's "MediaType".

Relevant tests were added to "core/modules.rs" and integration tests,
additionally multiple WPT tests were enabled.

There are still some rough edges in the implementation and not all WPT were
enabled, due to:
a) unclear BOM handling in source code by "FileFetcher"
b) design limitation of Deno's "FileFetcher" that doesn't download the same
module multiple times in a single run

Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-12-15 19:22:36 +01:00
Elias Sjögreen
ee49cce726
feat(ext/ffi): implement UnsafePointer and UnsafePointerView (#12828) 2021-12-15 15:41:49 +01:00
Ben Noordhuis
4d176b7b7c
fix(ext/net): make unix and tcp identical on close (#13075)
std/http/server knows how to handle "Listener has been closed"
exceptions but not "operation canceled" errors.

Make "unix" listen sockets throw the same exception as "tcp" listen
sockets when the socket is closed and has a pending accept operation.

There is still a discrepancy when multiple accept requests are posted
but that's probably a less visible issue and something for another day.

Fixes #13033
2021-12-14 23:27:04 +01:00
Kitson Kelly
e8d7b430ce
chore: updates to support deno_graph API changes (#13080) 2021-12-15 07:39:20 +11:00
Luca Casonato
b220a58d1a
feat(ext/crypto): support exporting RSA JWKs (#13081)
This commit adds support for exporting RSA JWKs in the Web Crypto API.
It also does some minor fixes for RSA JWK imports.

Co-authored-by: Sean Michael Wykes <sean.wykes@nascent.com.br>
2021-12-14 17:02:14 +01:00
David Sherret
c9d32e0581
fix(lsp): handle import specifier not having a trailing quote (#13074)
* fix(lsp): handle import specifier not having a trailing quote

* clean up

* Add test.
2021-12-13 16:28:35 -05:00
Kitson Kelly
a54fc7a129
feat(lsp): improve registry completion suggestions (#13023)
Resolves #10051
2021-12-14 06:24:11 +11:00
Yoshiya Hinosawa
308813ae29
fix(ext/web): set location undefined when --location is not specified (#13046) 2021-12-14 00:35:59 +09:00
Jesper van den Ende
a2b4d13540
docs: Fix typo in EmitOptions (#13062) 2021-12-13 13:26:03 +01:00
Bartek Iwańczuk
0dec9b4381
fix: op_set_exit_code (#13034)
Fixes "op_set_exit_code" by sharing a single "Arc" between
all workers (via "op state") instead of having a "global" value stored in
"deno_runtime" crate. As a consequence setting an exit code is always
scoped to a tree of workers, instead of being overridable if there are
multiple worker tree (like in "deno test --jobs" subcommand).

Refactored "cli/main.rs" functions to return "Result<i32, AnyError>" instead
of "Result<(), AnyError>" so they can return exit code.
2021-12-11 15:56:45 +01:00
Bartek Iwańczuk
13d7d57227
feat(watcher): clear screen on each restart (#12613)
This commit adds automatic clearing of terminal screen after
restarting execution on file change.
2021-12-11 01:12:25 +01:00
VishnuJin
2bdb528eb8
feat(repl): add --unsafe-ignore-certificate-errors flag (#13045) 2021-12-10 15:47:55 +01:00
Luca Casonato
6f8f1cc244
tests: deflake crypto InvalidIntializationVector (#13040)
Use fixed data that is known to error as the test intends.
2021-12-10 11:47:21 +01:00
David Sherret
f530189c50
fix(watch): mitigate race condition between file write by other process and watch read (#13038) 2021-12-09 20:24:37 -05:00
Kitson Kelly
616ff1d482
chore: place @deprecated tag after documentation block (#13037) 2021-12-10 11:05:50 +11:00
Kitson Kelly
345f0fbe5c
feat(cli): update to TypeScript 4.5 (#12410)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-12-10 09:12:21 +11:00
Kitson Kelly
2347e60934
feat(lsp): registry suggestion cache respects cache headers (#13010)
Fixes #9931
2021-12-09 22:16:17 +11:00
Yoshiya Hinosawa
69ad5f0e78
feat(ext/timers): add refTimer, unrefTimer API (#12953) 2021-12-09 17:00:55 +09:00
David Sherret
1507b8c984
fix: upgrade swc fixing many bundling and --no-check bugs (#13025) 2021-12-08 19:12:14 -05:00
WenheLI
b51b0c834b
feat(cli): use deno fmt for lock and coverage files (#13018) 2021-12-07 19:21:04 -05:00
Yoshiya Hinosawa
5c0636888c
fix(ext/timers): fix flakiness of httpConnAutoCloseDelayedOnUpgrade test (#13017) 2021-12-08 02:50:35 +09:00
Andreu Botella
33da15ae5a
refactor(timers): refactor timers to use one async op per timer (#12862)
This change also makes the timers implementation closer to the spec, and
sets up the stage to implement AbortSignal.timeout() (whatwg/dom#1032).

Fixes #8965
Fixes #10974
Fixes #11398
2021-12-07 13:39:58 +01:00
Bartek Iwańczuk
5027826a64
build: pin dependencies in cli crate (#12967) 2021-12-07 01:43:09 +01:00
Ryan Dahl
a2f1357fe8
chore: upgrade to rustls 0.20 (#12488)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Bert Belder <bertbelder@gmail.com>
2021-12-07 00:48:11 +01:00
Divy Srivastava
d31378726e
feat(ext/crypto): implement unwrapKey (#12539) 2021-12-05 04:55:11 +01:00
Bartek Iwańczuk
c59f90d01f
chore: upgrade to Rust 1.57.0 (#12968) 2021-12-04 14:19:06 +01:00
Luca Casonato
72e9720e91
chore: merge v1.16.4 into main (#12984) 2021-12-04 01:26:54 +01:00
Ryan Dahl
084caffc08
refactor: cli doesn't need to depend on deno_tls (#12952)
also move create_http_client to deno_fetch
2021-12-01 11:13:11 -05:00
KnorpelSenf
4c36fa1fdf
chore: Fix typo in no-pending-ops error message (#12948) 2021-12-01 15:22:11 +01:00
Andreu Botella
9a10668694
fix(test): Improve reliability of deno test's op sanitizer with timers (#12934)
Although not easy to replicate in the wild, the `deno test` op sanitizer
can fail when there are intervals that started before a test runs, since
the op sanitizer can end up running in the time between the timer op for
an interval's run resolves and the op for the next run starts.

This change fixes that by adding a new macrotask callback that will run
after the timer macrotask queue has drained. This ensures that there is
a timer op if there are any timers which are unresolved by the time the
op sanitizer runs.
2021-11-30 01:27:30 +01:00
Kitson Kelly
18a63dd977
feat: add --no-check=remote flag (#12766)
Closes #11970
2021-11-30 09:23:30 +11:00
Zheyu Zhang
bd989143e1
refactor(cli): simplify lint/format resolver logic (#12898) 2021-11-29 09:17:57 -05:00
Andreu Botella
4a13c320d7
fix(workers): Make worker.terminate() not immediately kill the isolate (#12831)
Due to a bug in V8, terminating an isolate while a module with top-level
await is being evaluated would crash the process. This change makes it
so calling `worker.terminate()` will signal the worker to terminate at
the next iteration of the event loop, and it schedules a proper
termination of the worker's isolate after 2 seconds.
2021-11-29 13:37:44 +01:00
Bartek Iwańczuk
5178e093ed
Revert "fix(test): Improve reliability of deno test's op sanitizer with timers (#12908)" (#12929)
This reverts commit d335343a79.
2021-11-29 12:07:47 +01:00
Michael Busby
6c09e02304
feat(ext/net): enable sending to broadcast address (#12860)
You can now send UDP datagrams to the broadcast address.
2021-11-29 11:14:46 +01:00
Andreu Botella
d335343a79
fix(test): Improve reliability of deno test's op sanitizer with timers (#12908)
Although not easy to replicate in the wild, the `deno test` op sanitizer
can fail when there are intervals that started before a test runs, since
the op sanitizer can end up running in the time between the timer op for
an interval's run resolves and the op for the next run starts.

This change fixes that by adding a new macrotask callback that will run
after the timer macrotask queue has drained. This ensures that there is
a timer op if there are any timers which are unresolved by the time the
op sanitizer runs.
2021-11-28 16:40:38 +01:00
Andreu Botella
1974eb1021
fix(websocket): bad rid on WebSocketStream abort(#12913)
Fix a bad resource ID error when aborting a WebSocketStream immediately
after its creation.
2021-11-28 12:25:49 +01:00
Ben Noordhuis
993a1dd41a
feat(runtime): add op_set_exit_code (#12911)
Set the exit code to use if none is provided to Deno.exit(), or when
Deno exits naturally.

Needed for process.exitCode Node compat. Paves the way for #12888.
2021-11-28 00:45:38 +01:00
Yury Selivanov
1d3f734e18
feat(ext/net): ALPN support in Deno.connectTls() (#12786) 2021-11-26 19:59:53 +01:00
Andreu Botella
d763633781
feat(etc/fetch): Support WebAssembly.instantiateStreaming for file fetches (#12901)
Fetching of local files, added in #12545, returns a response with no
headers, including the `Content-Type` header. This currently makes it
not work with the WebAssembly streaming APIs, which require the response
to have a content type of `application/wasm`.

Since the only way to obtain a `Response` object with a non-empty `url`
field is via `fetch()`, this change changes the content type requirement
to only apply to responses whose url has the `file:` scheme.
2021-11-26 19:52:41 +11:00
David Sherret
6a780543a4
refactor(repl): move rustyline sync channel communication into struct (#12900) 2021-11-25 14:05:12 -05:00
Ben Noordhuis
47cf7b0b2e
fix(cli): fix slow test, unbreak ci (#12897)
Reduce the number of iterations from 1,024 to 128.

On my big bruiser of a desktop machine it already takes up close to a
minute to complete when nothing else is running so no way it's going to
finish in the allotted time on the CI.

The fact that the test used to pass may be indicative of a performance
regression somewhere but it's not clear to me when or where that would
have been introduced.

Fixes #12887.
2021-11-25 14:25:22 +01:00
Bartek Iwańczuk
1193d46485
tests: add 'await' to all invocations of 'assertRejects' (#12893) 2021-11-25 02:23:03 +01:00
Bartek Iwańczuk
e68a241946
chore: upgrade lspower to 1.4.0 (#12894) 2021-11-25 12:10:12 +11:00
Bert Belder
c6f3493f18
chore: merge v1.16.3 into main (#12892) 2021-11-24 15:56:18 -08:00
David Sherret
adc5974333
fix(lsp): lsp should respect include/exclude files in format config (#12876) 2021-11-24 15:14:19 -05:00
Bartek Iwańczuk
1117d2db39
compat: support compat mode in REPL (#12882)
This commit introduces "ProcState::maybe_resolver" field, which
stores a single instance of resolver for the whole lifetime of the
process, instead of creating these resolvers for each creation
of module graph. As a result, this resolver can be used in fallback
case where graph is not constructed (REPL, loading modules using
"require") unifying resolution logic.
2021-11-24 16:55:10 +01:00
Bartek Iwańczuk
1a51f2392d
chore: speed up compat tests (#12884)
This commit speeds up compat tests by using local copy of "deno_std"
instead of downloading it from https://deno.land for each test.
Additionally type checking is skipped.
2021-11-24 12:24:13 +01:00
David Sherret
0f90b4665a
chore(lsp): fix possible race condition with tests expecting 3 publishDiagnostics messages (#12868)
The tests expect 3 publish notifications. It was possible for less than 3 to occur if two or more tasks set the diagnostics in the collection, exited the lock at the same time, then called `publish_diagnostics`
2021-11-23 20:04:27 -05:00
Zheyu Zhang
fd6d0e309c
fix(cli/compile): skip bundling for pre-bundled code (#12687) 2021-11-23 23:59:17 +01:00
Nayeem Rahman
63fc73c491
refactor(cli): deduplicate source cache for redirected specifiers (#12795) 2021-11-24 08:30:52 +11:00
Nayeem Rahman
7413c96985
fix(cli): don't cache .tsbuildinfo unless emitting (#12830)
Fixes #12755
Fixes #12807
Fixes #12832
2021-11-24 08:20:30 +11:00
Bartek Iwańczuk
d2c53e7f10
tests: remove 'fmt_check_tests_dir' test (#12875) 2021-11-23 18:36:13 +01:00
igorsaux
3f8c3b8568
fix(lsp): normalize urls in did_change_watched_files (#12873) 2021-11-23 12:32:40 -05:00
Bartek Iwańczuk
bedb2adfb0
refactor: remove "unitTest" wrapper from cli/tests/unit (#12750) 2021-11-23 17:45:18 +01:00
David Sherret
51e3db956a
fix(cli): config file should resolve paths relative to the config file (#12867)
* Add `specifier_to_file_path` to support converting a ModuleSpecifier with a unix-style path to a PathBuf on Windows.
2021-11-23 10:38:11 -05:00
Bartek Iwańczuk
d8afd56838
feat(test): Add more overloads for "Deno.test" (#12749)
This commit adds 4 more overloads to "Deno.test()" API.

```
// Deno.test(function testName() { });
export function test(fn: (t: TestContext) => void | Promise<void>): void;

// Deno.test("test name", { only: true }, function() { });
export function test(
  name: string,
  options: Omit<TestDefinition, "name">,
  fn: (t: TestContext) => void | Promise<void>,
): void;

// Deno.test({ name: "test name" }, function() { });
export function test(
  options: Omit<TestDefinition, "fn">,
  fn: (t: TestContext) => void | Promise<void>,
): void;

// Deno.test({ only: true }, function testName() { });
export function test(
  options: Omit<TestDefinition, "fn" | "name">,
  fn: (t: TestContext) => void | Promise<void>,
): void;
```
2021-11-23 14:57:51 +01:00
Luca Casonato
ae34f8fa10
fix: support "other" event type in FSWatcher (#12836)
This commit adds support for "other" events in `FSWatcher`. Flags on
events are now exposed via the `flag` property  on `FsEvent`.
2021-11-23 11:30:24 +01:00
Kitson Kelly
210300d049
feat(lsp): add type definition provider (#12789) 2021-11-23 11:09:19 +11:00
Kitson Kelly
bf5657cd59
feat(lsp): add workspace symbol provider (#12787) 2021-11-23 11:08:56 +11:00
igorsaux
3abe31252e
fix(lsp): use lint exclude files list from the config file (#12825) 2021-11-22 18:10:33 -05:00
Luca Casonato
71ceca0ffc
fix(ext/crypto): don't panic on decryption failure (#12840) 2021-11-22 23:58:21 +01:00
Luca Casonato
3cc724c9ba
fix(runtime): support reading /proc using readFile (#12839) 2021-11-22 16:53:58 +01:00
Luca Casonato
429c773a2e
tests: extend readFile file length during read (#12835)
This commit adds some tests that demonstrate that Deno.readFile reads
the entire file, even if the read file is extended during read.
2021-11-22 16:25:42 +01:00
David Sherret
ddfba7d8ca
fix(fmt): markdown formatting was incorrectly removing some non-breaking space html entities (#12818) 2021-11-19 12:54:41 -05:00
David Sherret
c82ce74133
refactor(lsp): remove Documents mutex and require Documents to be mutated to change it (#12747) 2021-11-18 13:50:24 -05:00
Kitson Kelly
14f83da221
fix(lsp): tag deprecated diagnostics properly (#12801) 2021-11-18 13:05:20 +11:00
Bert Belder
77c4c249ba
test(ext/http): DELETE requests should always have body (#12798)
Refs: #12741
Refs: #12746
2021-11-17 15:34:41 -08:00
David Sherret
4836ab769c
1.16.2 (#12794) 2021-11-17 11:00:58 -05:00
David Sherret
cd61cedd19
chore: bump crates for 1.16.2 (#12792) 2021-11-17 10:14:23 -05:00
Kitson Kelly
cc38580106
fix(lsp): retain module dependencies when parse is invalid (#12782)
Fixes #12753
2021-11-17 09:23:25 +11:00
Ryan Dahl
b2036a4db7
refactor: re-export anyhow from deno_core (#12777) 2021-11-16 09:02:28 -05:00
Yacine Hmito
f9f9ddc5e3
tests(lsp): regression test for providing completions when editing documents (#12776)
Ref: #12753
2021-11-16 13:59:33 +11:00
Ryan Dahl
01644488ae
refactor: clean up cli/file_fetcher.rs (#12772) 2021-11-15 19:59:19 -05:00
Nayeem Rahman
cd9193f126
fix(cli): short-circuit in prepare_module_load() (#12604) 2021-11-16 10:25:52 +11:00
David Sherret
243d3ba755
fix(transpile): do not panic on swc_ecma_utils::HANDLER diagnostics (#12773) 2021-11-15 18:04:34 -05:00
David Sherret
ec9f5d5af2
feat(unstable/test): include test step pass/fail/ignore counts in final report (#12432) 2021-11-15 10:20:37 -05:00
Geert-Jan Zwiers
58e7b290dc
fix(test): support typechecking docs with CRLF line endings (#12748) 2021-11-15 09:58:04 -05:00
David Sherret
28dbb4a95e
refactor(lsp): prefer using document instead of documents collection (#12720) 2021-11-12 11:42:04 -05:00
Luca Casonato
fdf890a68d
v1.16.1 2021-11-11 11:59:29 +01:00
Luca Casonato
3250ffe020
chore: bump crate versions for 1.16.1 (#12729) 2021-11-11 11:16:05 +01:00
Luca Casonato
08067b5e12
fix: add typings for AbortSignal.reason (#12730) 2021-11-11 10:28:06 +01:00
upendra1997
e00bfecf96
fix(crypto): handling large key length in HKDF (#12692) 2021-11-11 10:04:17 +01:00
Bert Belder
72a6231a61
refactor(ext/http): rewrite hyper integration and fix bug (#12732)
Fixes: #12193
Fixes: #12251
Closes: #12714
2021-11-10 14:51:43 -08:00
Luca Casonato
6af916c3f4
fix: non ascii buffer response in http server (#12728) 2021-11-10 16:48:46 +01:00
Bartek Iwańczuk
8ce53dd22b
fix: update unstable Deno props for signal API (#12723) 2021-11-10 14:30:20 +01:00
Geert-Jan Zwiers
9817c24642
typo 2021-11-09 13:43:23 -05:00
Aaron O'Mullan
375ce63c63
feat(core): streams (#12596)
This allows resources to be "streams" by implementing read/write/shutdown. These streams are implicit since their nature (read/write/duplex) isn't known until called, but we could easily add another method to explicitly tag resources as streams.

`op_read/op_write/op_shutdown` are now builtin ops provided by `deno_core`

Note: this current implementation is simple & straightforward but it results in an additional alloc per read/write call

Closes #12556
2021-11-09 19:26:17 +01:00
Luca Casonato
1eae6c139e
v1.16.0 2021-11-09 13:55:05 +01:00
Luca Casonato
4f64acd4e4
chore: bump crate versions for 1.16.0 (#12706) 2021-11-09 13:03:17 +01:00
Luca Casonato
0de6d1edc4
fix(fetch): set content-length for empty POST/PUT (#12703)
This commit changes `fetch` to set `content-length: 0` on POST and PUT
requests with no body.
2021-11-09 12:10:40 +01:00
Luca Casonato
75793baae8
Revert "refactor(ext/http): rewrite hyper integration and fix bug (#12332)" (#12704)
This reverts commit 5b1e537446.
2021-11-09 12:10:21 +01:00
Kitson Kelly
31fde9deba
chore(lsp): align ScriptElementKind to current versions of TypeScript/vscode (#12663) 2021-11-09 21:45:40 +11:00
Luca Casonato
22dd1b90c4
fix(cli/upgrade): nice error when unzip is missing (#12693)
Previously just a generic "error: No such file or directory (os error
2)" was printed. Now "`unzip` was not found on your PATH, please install
`unzip`" will be printed.
2021-11-09 11:06:45 +01:00
Kitson Kelly
f5eb177f50
feat(cli): support React 17 JSX transforms (#12631)
Closes #8440
2021-11-09 12:26:39 +11:00
David Sherret
45425c1146
fix(lint): use recommended tags when no tags specified in config, but includes or excludes are (#12700) 2021-11-08 20:10:33 -05:00
Bert Belder
5b1e537446
refactor(ext/http): rewrite hyper integration and fix bug (#12332)
Fixes: #12193
2021-11-08 12:49:11 -08:00
Bert Belder
f1b1a3f389
refactor: move mod tokio_util to runtime (#12332)
This avoids a bunch of duplicated code.
2021-11-08 12:49:11 -08:00
Luca Casonato
80d3a5f8be
feat: update to V8 9.7 (#12685)
This commit updates the rusty_v8 to 0.34.0. This commit also adds
the required typings for the new Array#findLast and Array#findIndexLast
methods.
2021-11-08 14:24:54 +01:00
Yoshiya Hinosawa
8e010b6844
feat(compat): add .code to dyn import error (#12633) 2021-11-08 16:02:40 +09:00
Kitson Kelly
182de1452b
fix(lsp): display module types only dependencies on hover (#12683)
Fixes: #12675
2021-11-08 11:50:48 +11:00
Kitson Kelly
91f8bdda2c
fix(lsp): cache unsupported import completion origins (#12661)
Fixes #12621
2021-11-08 09:35:32 +11:00
Luca Casonato
b6b25671b2
fix(lsp): display signature docs as markdown (#12636)
These were previously displayed as plain text. Now they are displayed as
`MarkupContent` with type `Markdown`.
2021-11-07 23:26:11 +01:00
Aaron O'Mullan
0f8299d011
fix(cli): don't panic when mapping unknown errors (#12659)
Instead fallback to generic "Error" class, fixes #12590, also update WPT expectations
2021-11-07 15:33:56 +01:00
Aaron O'Mullan
44511e4f33
feat(runtime): give OS errors .code attributes (#12591)
This adds `.code` attributes to errors returned by the op-layer, facilitating classifying OS errors and helping node-compat.

Similar to Node, these `.code` attributes are stringified names of unix ERRNOs, the mapping tables are generated by [tools/codegen_error_codes.js](https://gist.github.com/AaronO/dfa1106cc6c7e2a6ebe4dba9d5248858) and derived from libuv and rust's std internals
2021-11-04 16:44:34 +01:00
Zheyu Zhang
efe956b4fd
fix(lint): use recommended tag if there is no tags in config file or flags (#12644) 2021-11-04 11:12:12 -04:00
Luca Casonato
318dcc33af
Revert "feat(cli): enable useUnknownInCatchVariables by default" (#12643)
This partially reverts commit a065604155.

Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-11-04 11:30:37 +01:00
Ryan Dahl
7c2abb9d57
fix: Deno.emit crashes with BorrowMutError (#12627)
Warn on await_holding_refcell_ref clippy rule to avoid this in the future.

Fixes #12453
2021-11-03 09:27:36 -04:00
Bartek Iwańczuk
8e31bbbe55
chore: update to Rust edition 2021 (#12578) 2021-11-02 10:03:37 -04:00
David Sherret
70336912b4
fix(fmt): reduce likelihood of deno fmt panic for file with multi-byte chars (#12623) 2021-11-02 09:42:53 -04:00
David Sherret
0ec151b8cb
chore: upgrade deno_ast to 0.5.0 (#12595) 2021-11-01 16:22:27 -04:00
David Sherret
2794d0b7a2
fix(fmt/lint): strip unc paths on Windows when displaying file paths in lint and fmt (#12606) 2021-11-01 16:22:08 -04:00
Ryan Dahl
b92019a847
port check_if_should_use_esm_loader to rust (#12562) 2021-11-01 14:46:07 -04:00
Kitson Kelly
d3662e487d
feat(ext/fetch): support fetching local files (#12545)
Closes #11925
Closes #2150

Co-authored-by: Bert Belder <bertbelder@gmail.com>
2021-11-01 15:29:46 +11:00
Dezső Mészáros
d080f1c965
chore(cli): fix typo in variable name (#12617) 2021-11-01 08:34:58 +11:00
Bartek Iwańczuk
61e9beaa7b
feat: Stabilize Deno.TestDefinition.permissions (#12078) 2021-10-31 19:45:37 +01:00
Bartek Iwańczuk
e06515c5a9
feat(test): better formatting for test elapsed time (#12610)
This commit changes formatting of elapsed time in test
runner output.

Instead of "XXXms", reporter outputs one of:
- "XXXms" for <1000ms
- "XXs" for <60s
- "XXXmYYs" for >=60s
2021-10-30 22:49:46 +02:00
Kenta Moriuchi
95b9e5f30f
feat(ext/console): Display error.cause in console (#12462) 2021-10-30 19:25:46 +02:00
Zheyu Zhang
3fb23ab772
fix(cli): linter/formater watches current directory without args (#12550) 2021-10-30 19:20:56 +02:00
Zheyu Zhang
85a2943435
fix(cli): lint/format all discoverd files on each change (#12518) 2021-10-30 09:59:53 +02:00
David Sherret
d44011a69e
fix(runtime): require full read and write permissions to create symlinks (#12554) 2021-10-29 17:05:55 -04:00
Luca Casonato
b7341438f2
feat: stabilize Deno.startTls (#12581)
This commit stabilizes `Deno.startTls` and removes `certFile` from the
`StartTlsOptions`.
2021-10-29 17:13:31 +02:00
Andreu Botella
bc8e94155a
fix(encoding): support additional encoding labels (#12586) 2021-10-29 10:31:42 +05:30
Kitson Kelly
34a9ddff09
refactor(lsp): use deno_graph and single document struct (#12535)
Closes #12473
2021-10-29 10:56:01 +11:00
Kitson Kelly
117d9d2087
fix(bench): migrate to v8 from rusty_v8 (#12571)
Fixes #12569
2021-10-28 21:40:27 +11:00
Bartek Iwańczuk
f77c5701f7
feat(compat): integrate import map and classic resolutions in ESM resolution (#12549)
This commit integrates import map and "classic" resolutions in
the "--compat" mode when using ES modules; in effect
"http:", "https:" and "blob:" imports now work in compat mode.

The algorithm works as follows:

1. If there's an import map, try to resolve using it and if succeeded
return the specifier
2. Try to resolve using "Node ESM resolution", and if succeeded return
the specifier
3. Fall back to regular ESM resolution
2021-10-28 10:11:38 +02:00
Kitson Kelly
a065604155
feat(cli): enable useUnknownInCatchVariables by default (#12547)
Closes #11826

**BREAKING CHANGE** this behaviour was disable when introduced in Deno 1.14/TypeScript 4.4. It will highlight code that unsafely handles variables that are caught, and will cause type errors in unsafe code.
2021-10-28 08:43:40 +11:00
Luca Casonato
be68b82eb4
chore: update to rusty_v8 0.33.0 (#12564) 2021-10-27 23:26:15 +02:00
Kitson Kelly
b44b26c884
fix(cli): no-check respects inlineSources compiler option (#12559)
Fixes #12064
2021-10-27 17:18:53 +11:00
Kitson Kelly
1c739470b5
feat(ext/webstorage): use implied origin when --location not set (#12548)
Closes #11882

BREAKING CHANGE: Previously when `--location` was set, the unique storage key was derived from the the URL of the location instead of just the origin. This change correctly uses just the origin. This may cause previously persisted storage to change its key and data to not be available with the same location as before.
2021-10-27 11:10:27 +11:00
Leo K
6268703487
fix(ext/http): allow multiple values in upgrade header for websocket (#12551)
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
2021-10-26 23:06:44 +02:00
Bert Belder
cf9c4f0031
feat(ext/net): add TlsConn.handshake() (#12467)
A `handshake()` method was added that returns when the TLS handshake is
complete. The `TlsListener` and `TlsConn` interfaces were added to
accomodate this new method.

Closes: #11759.
2021-10-26 22:27:47 +02:00
Bert Belder
d936a8f3f8
chore: upgrade Rust to 1.56.0 (#12514) 2021-10-26 07:17:11 +02:00
Yoshiya Hinosawa
a9b34118a9
feat(runtime): add Deno.addSignalListener API (#12512) 2021-10-26 12:03:38 +09:00
Kitson Kelly
56d9a020d9
fix(cli): do not cache emit when diagnostics present (#12541)
Fixes #12471
2021-10-26 10:34:16 +11:00
Aaron O'Mullan
2ab3664e50
bench(http): avoid obj destructuring for parity with std (#12528)
Might close gap in benchmark graph between std & native
2021-10-25 18:51:17 +02:00
Andreu Botella
e39dace8cb
fix(tls): Make TLS clients support HTTP/2 (#12530)
`fetch()` and client-side websocket used to support HTTP/2, but this
regressed in #11491. This patch reenables it by explicitly adding `h2`
and `http/1.1` to the list of ALPN protocols on the HTTP and websocket
clients.
2021-10-25 18:41:06 +02:00
David Sherret
2e888cc824
fix: support verbatim UNC prefixed paths on Windows (#12438) 2021-10-25 11:54:36 -04:00
Yoshiya Hinosawa
f32f458318
v1.15.3 (#12533) 2021-10-25 20:11:55 +09:00
Yoshiya Hinosawa
c7dcf1cbdd
chore: bump crate version for 1.15.3 (#12531) 2021-10-25 15:48:01 +09:00
David Sherret
43cd0459b9
fix(lsp): formatting should error on certain additional swc diagnostics (#12491) 2021-10-21 10:18:18 -04:00
Bartek Iwańczuk
2997021615
fix: declare web types as global (#12497)
Co-authored-by: Feng Yu <F3n67u@outlook.com>
2021-10-21 08:47:14 +02:00
Bartek Iwańczuk
8a0e206ede
compat: add DENO_NODE_COMPAT_URL env variable (#12508) 2021-10-21 00:23:57 +02:00
Bert Belder
6a96560986
fix(ext/net): fix TLS bugs and add 'op_tls_handshake' (#12501)
A bug was fixed that could cause a hang when a method was
called on a TlsConn object that had thrown an exception earlier.

Additionally, a bug was fixed that caused TlsConn.write() to not
completely flush large buffers (>64kB) to the socket.

The public `TlsConn.handshake()` API is scheduled for inclusion in the
next minor release. See https://github.com/denoland/deno/pull/12467.
2021-10-20 01:30:04 +02:00
Nayeem Rahman
ad20e52c27
fix(cli/dts): update std links for deprecations (#12496) 2021-10-19 19:53:24 +02:00
Nayeem Rahman
e8ee5da459
fix(core/bindings): use is_instance_of_error() instead of is_native_error() (#12479) 2021-10-19 18:26:45 +02:00
Bartek Iwańczuk
f83c756aa0
refactor: use a single Mutex in ProcState for module graph (#12489)
This commit factors out 4 different fields from "ProcState", that are behind
"Arc<Mutex<>>" into a single struct behind a single mutex.
2021-10-19 16:01:46 +02:00
Nayeem Rahman
d77a4f1d43
fix(cli/tests): flaky Deno.watchFs() tests (#12485) 2021-10-19 07:50:13 -04:00
Robert Schultz
a2f53b105d
docs(Deno.Process.kill): Added example for Deno.Process.kill() (#12464) 2021-10-19 05:54:43 +02:00
Bartek Iwańczuk
71da814073
v1.15.2 2021-10-18 21:01:59 +02:00
Bartek Iwańczuk
1cd9272a91
chore: release crates for v1.15.2 (#12478) 2021-10-18 20:30:00 +02:00
Bartek Iwańczuk
617eeabe83
feat(unstable): Node CJS and ESM resolvers for compat mode (#12424)
This commit adds CJS and ESM Node resolvers to the "--compat" mode.

The functionality is spread across "cli/compat" module and Node compatibility
layer in "deno_std/node"; this stems from the fact that ES module resolution
can only be implemented in Rust as it needs to directly integrated with 
"deno_core"; however "deno_std/node" already provided CJS module resolution.

Currently this resolution is only active when running a files using 
"deno run --compat --unstable <filename>", and is not available in other
subcommands, which will be changed in follow up commits.
2021-10-18 19:36:28 +02:00
Nayeem Rahman
5a48d41bdd
fix(cli/fmt_errors): don't panic on source line formatting errors (#12449)
Returns empty values in case of errors, source lines are non-essential anyway. These errors can happen e.g. when source files change at runtime. A warning is also printed to help us track when it happens in unexpected cases besides this.
2021-10-18 18:05:36 +02:00
David Sherret
0a7ba33ed1
fix(fmt): keep parens for JS doc type assertions (#12475) 2021-10-18 10:21:42 -04:00
Bert Belder
ff932b411d
fix(core): poll async ops eagerly (#12385)
Currently all async ops are polled lazily, which means that op
initialization code is postponed until control is yielded to the event
loop. This has some weird consequences, e.g.

```js
let listener = Deno.listen(...);
let conn_promise = listener.accept();
listener.close();
// `BadResource` is thrown. A reasonable error would be `Interrupted`.
let conn = await conn_promise;
```

JavaScript promises are expected to be eagerly evaluated. This patch
makes ops actually do that.
2021-10-17 19:50:42 +02:00
Bert Belder
62f43030b4
chore(cli/tests): fix flaky fs watcher tests (#12385)
On OS X, the watcher sometimes witnesses the creation of it's own root
directory. Creating that directory using a sync op instead of an async
op sidesteps the issue.
2021-10-17 15:12:48 +02:00
David Sherret
62f6865f7c
fix: fmt should not remove parens around sequence expressions (#12461) 2021-10-16 14:57:45 -04:00
Kitson Kelly
34418884f4
fix(cli): re-enable allowSyntheticDefaultImports for tsc (#12435)
Fixes #12434
2021-10-14 21:13:15 +11:00
Nayeem Rahman
86f7bf89c5
fix(cli/tests): move worker test assertions out of message handlers (#12439) 2021-10-14 11:44:33 +02:00
Kenta Moriuchi
1d55fcb74c
fix(console): fix display of primitive wrapper objects (#12425) 2021-10-14 12:52:08 +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
43a63530ac
chore: test for bundling export specifier with alias (#12421) 2021-10-13 08:55:28 -04:00
David Sherret
d5a7a6d575
chore: fix flaky steps_invalid_usage tests (#12422) 2021-10-13 08:55:12 -04:00
David Sherret
b1d63aefd9
1.15.1 2021-10-13 13:18:18 +05:30
David Sherret
c2190be62a
fix: bundler should have a hygiene pass (#12418) 2021-10-12 22:47:11 -04:00
David Sherret
51f680f3d6
fix: --no-check not properly handling code nested in TS expressions (#12416) 2021-10-12 21:27:22 -04:00
Satya Rohith
de3fa08d6c
1.15.0 2021-10-12 23:27:07 +05:30
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
Divy Srivastava
58f04d8e46
feat(ext/crypto): implement deriveKey (#12117) 2021-10-12 16:09:46 +05:30
Bartek Iwańczuk
f332d72f16
fix(lsp): lint diagnostics respect config file (#12338)
This commit fixes problem with LSP where diagnostics coming
from "deno lint" don't respect configuration file.

LSP was changed to store "Option<ConfigFile>", "Option<LintConfig>"
and "Option<FmtConfig>" on "Inner"; as well as storing "Option<LintConfig>"
and "Option<FmtConfig>" on "StateSnapshot".

Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-10-12 00:02:33 +02:00
Aaron O'Mullan
5bad8e1773
perf(webidl): inline ResponseInit converter (#12285) 2021-10-11 23:43:52 +02:00
Bartek Iwańczuk
5508a0f45e
feat(compat): pin specific version of std/node (#12396) 2021-10-11 23:14:46 +02: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
Luca Casonato
c40d5040cd
fix(http): don't expose body on GET/HEAD requests (#12260)
GET/HEAD requests can't have bodies according to `fetch` spec. This
commit changes the HTTP server to hide request bodies for requests with
GET or HEAD methods.
2021-10-11 18:39:55 +02:00
Casper Beyer
1683044ed9
feat: provide ops details for ops sanitizer failures (#12188) 2021-10-11 17:00:33 +02:00
Divy Srivastava
3b2cb8e711
feat(ext/crypto): implement AES-CBC encryption & decryption (#12123)
* initial stuff

* stuff

* merge stuff

* cleanup

* fmt

* length

* update lockfile

* decrypt

* fixy

* clippy hello?

* hmm

* fixs

* fix lint

* add AesCbcParams

* fixes

* fixy

* lockfile fixy

* fix dumb assertions

* re run CI

* rerun CI

* rerun CI
2021-10-11 16:37:51 +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
Divy Srivastava
423b02d889
fix(ext/ffi): types for nonblocking FFI (#12345) 2021-10-11 15:09:11 +02:00
Kitson Kelly
a7baf5f2bb
refactor: integrate deno_graph into CLI (#12369) 2021-10-11 08:26:22 +11: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
Aaron O'Mullan
f2ac7ff23a
bench(deno_common): track void ops (#12389)
To track overhead through the entire CLI opcall stack (metrics included, etc...)
2021-10-10 16:36:55 +02:00
Andreu Botella
5edd277161
feat: Show the URL of streaming WASM modules in stack traces (#12268)
WebAssembly modules compiled through `WebAssembly.compile()` and similar
non-streaming APIs don't have a URL associated to them, because they
have been compiled from a buffer source. In stack traces, V8 will use
a URL such as `wasm://wasm/d1c677ea`, with a hash of the module.

However, wasm modules compiled through streaming APIs, like
`WebAssembly.compileStreaming()`, do have a known URL, which can be
obtained from the `Response` object passed into the streaming APIs. And
as per the developer-facing display conventions in the WebAssembly
Web API spec, this URL should be used in stack traces. This change
implements that.
2021-10-10 16:03:23 +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
Feng Yu
ffea0f198c
test: remove duplicate import (#12374) 2021-10-10 15:24:03 +02:00
Satya Rohith
29f9e14457
feat: stabilize Deno.resolveDns (#12368) 2021-10-10 15:46:11 +05:30
Satya Rohith
25771b3d9b
feat(ext/net): relevant errors for resolveDns (#12370) 2021-10-10 15:44:45 +05:30
Divy Srivastava
a5d3c8b06c
feat(ext/crypto): implement deriveBits for ECDH (p256) (#11873) 2021-10-08 17:29:36 +02:00
Bartek Iwańczuk
c49a057599
feat(compat): inject Node globals in REPL (#12352) 2021-10-08 17:11:33 +02:00
Aaron O'Mullan
6b43e862fd
feat(runtime): allow passing extensions via Worker options (#12362) 2021-10-08 17:03:49 +02:00
Divy Srivastava
2155e7545f
fix(ext/ffi): missing "buffer" type definitions (#12371) 2021-10-08 16:32:57 +02:00
Nayeem Rahman
330aaae936
tests: make worker test deterministic (#12361) 2021-10-07 22:53:09 +02:00
Aaron O'Mullan
370c27e09a
feat(core): cleaner opcall stack traces (#12358) 2021-10-07 18:39:27 +02:00
Bert Belder
822047b845
fix(runtime): don't equate SIGINT to SIGKILL on Windows (#12356) 2021-10-07 16:31:02 +02:00
Bartek Iwańczuk
4e3068be63
Revert "fix(cli): ensure empty lines don't count towards coverage (#11957)" (#12348)
This reverts commit d5b38a9929.
2021-10-06 19:28:28 +02:00
Bartek Iwańczuk
b686907a45
feat(compat): inject Node globals (#12342)
This commit adds automatic injection of Node globals when "--compat" flag
is present.

This is done by executing "https://deno.land/std/node/global.ts" as a "side module",
before main module is executed.

This commit makes "--compat" required to be used with "--unstable" flag, as some
of Node globals require unstable Deno APIs.
2021-10-06 19:07:04 +02:00
Divy Srivastava
3aa8591595
feat(ext/crypto): export spki for RSA (#12114) 2021-10-06 11:18:12 +02:00
Casper Beyer
d5b38a9929
fix(cli): ensure empty lines don't count towards coverage (#11957) 2021-10-06 07:05:18 +02:00
Ryan Dahl
10c415eaaa
Remove some unused benchmarks (#12315) 2021-10-05 22:27:44 -04:00
Bartek Iwańczuk
37a24c7bdf
feat(compat): add support for node: prefixed built-ins (#12337)
Adds support for "node:" prefix for Node built-ins in "--compat" mode.

As per https://nodejs.org/api/esm.html#esm_node_imports
2021-10-06 01:25:13 +02:00
CGQAQ
c555b31d40
feat(lint): add support for --watch flag (#11983) 2021-10-05 23:07:38 +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
Bartek Iwańczuk
f1d3a17043
feat: add --compat flag to provide built-in Node modules (#12293)
This commit adds "--compat" flag. When the flag is passed a set of mappings for
built-in Node modules is injected into the import map. If user doesn't
explicitly provide an import map (using "--import-map" flag) then a map is
created on the fly. If there are already existing mappings in import map that
would clash with built-in Node modules a set of diagnostics is printed to the
terminal with suggestions how to proceed.
2021-10-05 01:35:55 +02:00
Bartek Iwańczuk
c6ae41fd87
test: refactor lint tests into directories (#12317)
Just reorganizing lint tests in such a way that adding new file in a directory doesn't change result of other tests.
2021-10-04 18:16:49 +02:00
Divy Srivastava
8884141c3f
fix(ext/crypto): missing Aes key typings (#12307) 2021-10-03 15:24:46 +02:00
Ahab
198f5b9514
fix(ext/net): should not panic when listening to unix abstract address (#12300) 2021-10-02 19:09:59 +02:00
Divy Srivastava
5065c7bcd9
feat(ext/crypto): implement wrapKey (#12125) 2021-10-01 11:39:49 +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
Divy Srivastava
c0b6c0eea5
fix(ext/crypto): decode id-RSASSA-PSS with default params (#12147) 2021-10-01 11:14:16 +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
David Sherret
cdac190583
chore: ensure first process in shared flock test does not enter and exit lock before second enters (#12255) 2021-09-30 15:45:13 -04:00
Andreu Botella
a2632c86b1
fix: Don't panic when a worker is closed in the reactions to a wasm operation. (#12270) 2021-09-30 19:52:58 +02:00
Sylvain Cau
ee2e25fba7
feat(cli/uninstall): add uninstall command (#12209) 2021-09-30 11:38:07 -04:00
Yoshiya Hinosawa
f602d63f48
fix(repl): avoid panic when assigned to globalThis (#12273) 2021-10-01 00:25:58 +09:00
Luca Casonato
0d7a417f33
feat(tls): custom in memory CA certificates (#12219)
This adds support for using in memory CA certificates for
`Deno.startTLS`, `Deno.connectTLS` and `Deno.createHttpClient`.

`certFile` is deprecated in `startTls` and `connectTls`, and removed
from `Deno.createHttpClient`.
2021-09-30 09:26:15 +02:00
Ahab
923d9c7786
fix(ext/fetch): avoid panic when header is invalid (#12244) 2021-09-29 18:42:06 +02:00
Aaron O'Mullan
cd913e51ef
bench(cli): add deno_http_native_headers.js (#12267) 2021-09-29 18:06:20 +02:00
Andreu Botella
cdb252af0a
feat: support serializing WebAssembly.Module objects (#12140) 2021-09-29 10:47:24 +02:00
Aaron O'Mullan
3ab682918a
1.14.2 (#12254) 2021-09-28 14:00:26 +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
Ben Noordhuis
2b6f8d0187
fix(ext/http): include port number in h2 urls (#12181) 2021-09-26 20:26:16 +02:00
Luis Malheiro
b095157c1d
perf(ext/fetch): Use the WebIDL conversion to DOMString rather than USVString for Response constructor (#12201) 2021-09-25 15:30:31 +02:00
Aaron O'Mullan
3c88dffd32
fix(http): panic when responding to a closed conn (#12216)
Our oneshot receiver in `HyperService::call` would unwrap and panic, the `.await` on the oneshot receiver happens when the sender is dropped.

The sender is dropped in `op_http_response` because:
1. We take `ResponseSenderResource`
2. Then get `ConnResource` and early exit on failure (conn already closed)
3. The taken sender then gets dropped in this early exit before any response is sent over the channel

Fallbacking to returning a dummy response to hyper seems to be a fine quickfix
2021-09-25 13:22:19 +02:00
Andreu Botella
1a6249c971
chore(workers): Test that closing a worker closes any child workers (#12215)
Before #12156, closing a worker which had children would cause a panic
(https://github.com/denoland/deno/issues/11342#issuecomment-918327693).

After that PR, closing a worker will also close any child workers.
2021-09-24 19:26:57 -07:00
Ryan Dahl
683a38e47c
refactor: Remove unused code (#12210) 2021-09-25 00:35:35 +02:00
Ryan Dahl
9705efd419
refactor: Remove op_state parameter (#12202) 2021-09-24 11:11:16 -04:00
Ryan Dahl
01da1d0adc
refactor: Rename ProgramState to ProcState (#12204)
Move Arc into struct
2021-09-24 11:10:42 -04:00
Leo K
703ca905fd
docs: fix native http jsdoc examples (#12207) 2021-09-24 19:14:12 +09:00
Ryan Dahl
da25bbff88
refactor: clean up watcher tests (#12200) 2021-09-23 15:12:22 -04:00
Satya Rohith
c5442abc23
feat(cli/fmt): support more markdown extensions (#12195) 2021-09-23 21:49:25 +05:30
Casper Beyer
830586d242
test(cli): align unit test permissions with runtime test permissions (#12189) 2021-09-23 01:50:50 +02:00
Ryan Dahl
18fff69946
refactor: simplify FetchFuture (#12185)
No need for static lifetime
2021-09-22 15:35:07 -04: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
Casper Beyer
20692f3e84
chore: replace calls to assertThrowsAsync with assertRejects (#12176) 2021-09-22 09:21:11 -04:00
Kitson Kelly
f27902e749
1.14.1 2021-09-22 08:44:46 +10:00
Kitson Kelly
2a56cd545c
chore: bump crate versions for 1.14.1 (#12172) 2021-09-22 06:53:47 +10:00
Aaron O'Mullan
ac8b6689b2
bench(deno_common): track new Request() (#12164)
Indirectly tests for:
- url parsing
- abort signal no-ops
- webidl & other overhead
2021-09-21 12:34:27 +02:00
Satya Rohith
923c5432e0
chore: bump deno_net (#12157) 2021-09-21 09:20:21 +05:30
David Sherret
0f23d92601
chore(tests): windows pty tests (#12091) 2021-09-20 22:15:44 -04:00
Elias Sjögreen
60b68e63f1
test(ext/ffi): add tests for different parameter and return types (#12158) 2021-09-20 15:42:54 -07:00
Eyal Shalev
7c9c9e5c83
fix(config-schema): correct default value of "lib" (#12145)
Changed it from `"deno.window"` to `["deno.window"]`
2021-09-20 11:30:00 -04:00
Casper Beyer
269bf380e0
fix(cli): move Deno.flock and Deno.funlock to unstable types (#12138) 2021-09-19 14:46:54 +02:00
Casper Beyer
e1144fd635
refactor(cli): don't generate a module for side loading tests (#12129) 2021-09-18 16:12:50 +02: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
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
David Sherret
7c0173df27
chore(tests): maybe fix flaky flock tests (#12122) 2021-09-17 14:17:01 -04:00
David Sherret
4c8ab33def
chore(tests): fix flaky fetchPostBodyTypedArray (#12104) 2021-09-17 09:02:44 -04:00
David Sherret
c8b43a0328
chore(tests): fix flaky flock tests (#12099) 2021-09-17 09:02:23 -04:00
Squirrel
4b79e5a459
chore: Remove unused deps from Cargo.toml files (#12106) 2021-09-17 14:39:32 +02:00
Kitson Kelly
99de9eb4c2
fix(cli): don't ignore diagnostics about for await (#12116)
Fixes #12115
2021-09-17 16:54:52 +10:00
Divy Srivastava
9270cad67c
fix(ext/crypto): don't use core.decode for encoding jwk keys (#12088) 2021-09-16 09:12:38 +02:00
Satya Rohith
3c97dbf06b
chore: update tagline (#12095) 2021-09-16 11:55:06 +05:30
Kitson Kelly
ccb3387946
fix(lsp): align filter text to vscode logic (#12081)
Fixes #11861
2021-09-16 12:07:52 +10:00
Satya Rohith
badc87e657
chore(lsp): use pretty_assertions in e2e tests (#12083) 2021-09-15 16:04:17 +05:30
David Sherret
f92cc66f0d
1.14.0 (#12074) 2021-09-14 16:46:36 -04:00
David Sherret
16c27fce1f
chore: bump crate versions for 0.14 (#12072) 2021-09-14 15:38:35 -04:00
Bartek Iwańczuk
1848f43aa1
chore: update URL for schemas (#12070) 2021-09-14 16:39:58 +02:00
Divy Srivastava
c41460ecc4
feat(ext/crypto): import RSA pkcs#8 keys (#11891) 2021-09-14 15:21:20 +02:00
Kitson Kelly
d36b01ff69
fix(lsp): correctly parse registry patterns (#12063) 2021-09-14 14:40:35 +02:00
Satya Rohith
bb7ee4f445
feat(lsp): ignore specific lint for entire file (#12023) 2021-09-14 17:46:51 +05:30
Bartek Iwańczuk
6e3c8a4b05
chore: add JSON schema for configuration file (#12062) 2021-09-14 04:18:02 +02:00
Bartek Iwańczuk
94c5cd7b2c
docs: Update --config flag help text (#12059) 2021-09-14 00:41:34 +02:00
Bartek Iwańczuk
cba1e7b5a3
feat: add option flags to 'deno fmt' (#12060) 2021-09-13 22:06:45 +02:00
Bartek Iwańczuk
0dbeb774ba
feat(fmt): add support for configuration file (#11944)
This commit adds support for configuration file for "deno fmt"
subcommand. It is also respected by LSP when formatting
files.

Example configuration:
{
    "fmt": {
        "files": {
            "include": ["src/"],
            "exclude": ["src/testdata/"]
        },
        "options": {
            "useTabs": true,
            "lineWidth": 80,
            "indentWidth": 4,
            "singleQuote": true,
            "textWrap": "preserve"
        }
    }
}
2021-09-13 20:19:10 +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
274ff6c469
fix: change assertion in httpServerIncompleteMessage test (#12052) 2021-09-13 17:05:00 +02:00
Bartek Iwańczuk
a95ca9dc70
feat: stabilise Deno.upgradeWebSocket (#12024) 2021-09-13 14:06:12 +02:00
Geert-Jan Zwiers
3ef23e25c6
fix(cli): use updated names in deno info help text (#11989) 2021-09-13 13:50:04 +02:00
Andreu Botella
93290487eb
fix: worker_message_before_close was flaky (#12019) 2021-09-13 13:47:17 +02:00
Divy Srivastava
2199bdaf64
feat(ext/crypto): export RSA keys as pkcs#8 (#11880) 2021-09-13 11:33:28 +02:00
Satya Rohith
84f8747157
fix(lsp): support data urls in deno.importMap option (#11397) 2021-09-13 09:49:23 +05:30
Kitson Kelly
a442821d97
chore: update deno_* crates (#12020) 2021-09-13 10:06:36 +10:00
Nayeem Rahman
2cc1577d28
fix(ext/fetch): Properly cancel upload stream when aborting (#11966)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-09-13 01:19:38 +02:00
Divy Srivastava
0520ae62dd
fix(ext/crypto): add HkdfParams and Pkdf2Params types (#11991) 2021-09-12 23:02:49 +02:00
Ryan Dahl
13991e5995
refactor: Remove duplicated colors.rs file (#11990) 2021-09-12 12:04:17 -04:00
David Sherret
00d62e64bf
chore(lsp): temporarily reparse AST for linting (#11988) 2021-09-12 09:42:11 -04:00
Divy Srivastava
40c63d1255
feat(ext/crypto): verify ECDSA signatures (#11739) 2021-09-11 16:49:53 -04:00
Bartek Iwańczuk
d236f432b8
refactor: use import_map crate (#11974)
Removes ImportMap implementation from "cli/" and instead
uses "import_map" crate
2021-09-11 03:38:24 +02:00
Bartek Iwańczuk
bd4ca721eb
fix: Query string percent-encoded in import map (#11976)
This commit fixes a problem in import map when resolving
specifiers containing "?" or "#". 

Due to special handling of Windows specifiers required because 
of how "url" crate works, a regression was introduced that percent-encoded
all parts of URL that were not considered "path segments".

Co-authored-by: Andreu Botella <abb@randomunok.com>
2021-09-11 02:36:57 +02:00
Ryan Dahl
fb35cd0ef4
fix: permission prompt stuffing (#11931)
Fixes #9750
2021-09-09 08:38:47 -04:00
Nayeem Rahman
d947629292
fix(ext/web): Preserve stack traces for DOMExceptions (#11959) 2021-09-08 23:14:26 +02:00
Bartek Iwańczuk
85e316bd6b
chore: release deno_http 0.8.0 (#11956) 2021-09-08 19:32:19 +02:00
David Sherret
2958b05d0c
fix(test): propagate join errors in deno test (#11953) 2021-09-08 11:18:07 -04:00
Bartek Iwańczuk
5db1c401cd
fix: bring back Deno.Signal to unstable props (#11945) 2021-09-08 13:18:56 +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
2de5587547
fix(ext/http): resource leak if request body is not consumed (#11955) 2021-09-08 10:12:23 +02:00
Bartek Iwańczuk
c04117134e
refactor(lint): reuse lint rules (#11934)
This commit updated "deno_lint" crate to 0.15.1 and refactors
"cli/tools/lint.rs" to create only a single vector of lint rules,
instead of creating a vector for each linted file.
2021-09-08 07:08:33 +02:00
BasiqueEvangelist
08e12380a0
feat(cli): Support Basic authentication in DENO_AUTH_TOKENS (#11910) 2021-09-08 06:18:11 +02:00
Kitson Kelly
bf6dbf9855
fix(cli): better handling of source maps (#11954)
Ref: #11874
2021-09-08 14:05:34 +10:00
David Sherret
4833103011
fix: exit process on panic in a tokio task (#11942) 2021-09-07 19:34:27 -04:00
David Sherret
e3a484ae44
fix: remove windows-only panic when calling Deno.kill (#11948) 2021-09-07 18:45:13 -04:00
David Sherret
2c2e3ec1ca
refactor(lsp): use deno_ast and cache swc ASTs (#11780) 2021-09-07 10:39:32 -04:00
Nayeem Rahman
d331c4b283
fix(ext/web): Format terminal DOMExceptions properly (#11834) 2021-09-06 22:59:20 +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
Craig Morten
930cb0afd8
chore(std/http): server module name migration (#11890) 2021-09-05 22:43:46 +02:00
Feng Yu
bb99d5da4c
fix(doc): fix rustdoc bare_urls warning (#11921) 2021-09-05 16:22:45 +02:00
Casper Beyer
f9d29115a0
feat(cli): close test worker once all tests complete (#11727) 2021-09-04 20:19:26 +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
Bartek Iwańczuk
44ca3ce6ae
refactor: factor out DenoSubcommand enum variant into structs (#11896)
This commit refactors "DenoSubcommand" enum in a way that variants
no longer contain anonymous structures but instead contain
dedicated structures for each subcommand, eg. "DenoSubcommand::Lint"
now contains "LintSubcommand".
2021-09-04 01:33:35 +02:00
Bartek Iwańczuk
d93570a619
feat(lint): add support for config file and CLI flags for rules (#11776)
This commit adds support for following flags in deno lint subcommand:

--config - allows to load configuration file and parses "lint" object
--rules-tags=<tags> - allows specifying which set of tagged rules should be run
--rules-include=<rules> - allow specifying which rules should be run
--rules-exclude=<rules> - allow specifying which rules should not be run
2021-09-03 17:01:58 +02:00
David Sherret
c3001fe280
chore(test): improve flaky lsp_diagnostics_refresh_dependents test to give more info (#11905) 2021-09-02 20:31:59 -04:00
David Sherret
987716798f
feat(fmt): add basic JS doc formatting (#11902) 2021-09-02 18:28:12 -04:00
Luca Casonato
1bf7b90ca8
chore: update dependencies (#11856)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-09-02 23:38:44 +02:00
Bartek Iwańczuk
c84532b6d5
chore: upgrade crates (#11894)
Co-authored-by: David Sherret <dsherret@gmail.com>
2021-09-02 17:38:19 +02:00
Casper Beyer
77ead8af20
fix(cli): retain path based test mode inference (#11878) 2021-09-01 18:31:56 +09: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
fcd0992dba
fix: move unstable declarations to deno.unstable (#11876) 2021-08-31 11:25:15 +02:00
Luca Casonato
0aa6b1e79f
chore: update to rusty_v8 0.27.0 (#11877)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-08-30 18:40:00 +02:00
Divy Srivastava
5ee2110179
feat(ext/crypto): support JWK export for HMAC (#11864) 2021-08-29 14:23:51 +02:00
Aaron O'Mullan
8a097410a8
bench(deno_common): track readFile 128kb (#11862) 2021-08-29 01:05:32 +02:00
Divy Srivastava
1f57cd2c0f
feat(ext/crypto): support JWK import for HMAC (#11716) 2021-08-27 13:19:41 +02:00
Kitson Kelly
935133f53a
feat(cli): Update to TypeScript 4.4 (#11678) 2021-08-27 10:12:59 +10:00
Casper Beyer
b9a965c607
refactor(cli): introduce module specifier test modes (#11769)
This commit merges the two vectors of specifiers into a single one introducing
the concept of a "TestMode" which is a tri-state enum specifying how a specifier
is to be tested (as documentation, as an executable module or as both).

This is determined during the collection phase and determines how a specifier
will be executed based on how the specifier was collected (directly or not) and
if it has an eligible media_type when fetched.

For example "deno test README.md" is marked as documentation because, while it
is a direct inclusion it is not an executable media type therefore will only
have the fenced code blocks that can be parsed from it tested.
2021-08-26 21:21:58 +02:00
Sebastien Filion
192af1e7bc
docs: Add async iterator alternative for Deno.serveHttp (#11850) 2021-08-26 17:06:58 +02:00
David Sherret
5d7d9d6443
chore(tests): improve unit tests using deferred (#11842) 2021-08-25 16:04:14 -04:00
Sean Michael Wykes
dccf4cbe36
feat(fetch): mTLS client certificates for fetch() (#11721)
This commit adds support for specifying client certificates when using fetch, by means of `Deno.createHttpClient`.
2021-08-25 14:25:12 +02:00
Dayan C. Galiazzi
873cce27b8
fix(ext/http): websocket upgrade header check (#11830) 2021-08-25 00:55:32 +02:00
Casper Beyer
a3fd4bb998
fix(cli): dispatch unload event on watch drop (#11696) 2021-08-24 22:34:09 +02:00
Divy Srivastava
85a56e7144
feat(ext/crypto): implement encrypt, decrypt & generateKey for RSA-OAEP (#11654) 2021-08-24 21:59:02 +02:00
Sebastien Filion
e10d30c8ea
fix(typings): fix property name in DiagnosticMessageChain interface (#11821) 2021-08-24 11:53:38 -04:00
Casper Beyer
a7240c5091
feat(cli): add --ignore flag to test command (#11712) 2021-08-24 17:23:29 +02:00
Nicolas Stucki
c4561ac969
feat(extensions/console): right align numeric columns in table (#11748) 2021-08-24 17:17:40 +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
Nayeem Rahman
1b7848c4a9
feat(unstable): Support file URLs in Deno.dlopen() (#11658) 2021-08-24 15:09:00 +02:00
Nayeem Rahman
8c57a6b7e3
BREAKING(unstable): Fix casing in FfiPermissionDescriptor (#11659) 2021-08-24 15:08:41 +02:00
Leo K
f4a9db350f
chore(ext/webgpu): update wgpu to 0.10.0 (#11781)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2021-08-24 13:29:42 +02:00
David Sherret
7b882cc05f
1.13.2 (#11822) 2021-08-23 16:58:49 -04:00
David Sherret
6db8cbb650
chore: release crates for 1.13.2 (#11820) 2021-08-23 15:48:08 -04:00
Luca Casonato
df084b9f14
fix(ext/ffi): don't panic on invalid enum values (#11815)
Co-authored-by: Feng Yu <f3n67u@gmail.com>
2021-08-23 18:31:19 +02:00
Bartek Iwańczuk
2187c11e5d
fix(ext/http): resource leak on HttpConn.close() (#11805)
This commit adds tracking of resources that are related
to "HttpConn" so they can be closed automatically
when closing the connection.
2021-08-23 16:15:59 +02:00
Casper Beyer
2c17045aa8
refactor(cli/tools/test): infer disable log from program state (#11803) 2021-08-23 16:03:57 +02:00
Bartek Iwańczuk
dbcdd3a18e
fix: duplicate import in cli/main.rs (#11813) 2021-08-23 14:08:55 +02:00
Casper Beyer
f3b2f23a1d
refactor(cli/flags): use an optional non zero usize for fail-fast (#11804)
Changes the type of the `fail_fast` flag from `Option<usize>` to
`Option<NonZeroUsize>` as an optional value of zero isn't sound.
2021-08-23 12:37:02 +02:00
Casper Beyer
198699faba
fix(cli/flags): require a non zero usize for concurrent jobs (#11802) 2021-08-23 12:35:38 +02:00
Feng Yu
cb8f34c325
doc(test): add --location to unit test command (#11793) 2021-08-21 14:32:05 +02:00
Feng Yu
4c1e56b2f0
tests: remove redundant type assertion (#11794) 2021-08-21 16:55:28 +10:00
Kitson Kelly
0d83afd939
fix(lsp): better handling of languageId (#11755)
Fixes #11521
Fixes #11742
2021-08-19 13:19:12 +10:00
Pankaj Patil
e55454613c
docs(lsp): change deno/registryStatus -> deno/registryState (#11760) 2021-08-18 12:17:52 -04:00
Casper Beyer
71e558c71c
test: re-enable test watch tests and mark as flaky (#11669) 2021-08-18 15:35:24 +02:00
Luca Casonato
a66218d457
fix(runtime): event loop panics in classic workers (#11756)
Classic worker scripts are now executed in the context of a Tokio
runtime. This does mean we can not spawn more tokio runtimes in
"op_worker_sync_fetch". We instead spawn a new thread there, that can
create a new Tokio runtime that we can use to block the worker thread.
2021-08-18 15:19:22 +02:00
Casper Beyer
4b800f5d26
refactor(cli): pass optional op_init to create_main_worker (#11707)
Replaces the testing flag in create_main_worker with a more 
general purpose hook to register additional ops.
2021-08-17 12:08:39 +02:00
Divy Srivastava
af97535b7c
fix(ext/crypto): exportKey() for HMAC (#11737)
Fixes typings and innerKey processing (WPT doesn't test 
exportKey for HMAC so this wasn't caught earlier).
2021-08-17 11:29:32 +02:00
David Sherret
c67f6c13cd
1.13.1 2021-08-16 17:42:52 -04:00
David Sherret
a66a7bebbe
chore: release crates for 1.13.1 (#11729) 2021-08-16 16:49:14 -04:00
Ben Noordhuis
6ced7b0383 fix(ext/fetch): better error if no content-type
The streaming WASM support code inspects the Response object's
Content-Type header but if that was missing, it failed with a fairly
inscrutable "String.prototype.toLowerCase called on null or undefined"
exception. Now it raises a more legible "Invalid WebAssembly content
type" exception.
2021-08-16 19:45:37 +02:00
Ben Noordhuis
245987b2a7
chore(cli/tests): disable flaky test on macos ci (#11726)
Refs #11580.
2021-08-16 16:15:00 +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
Bartek Iwańczuk
d1d2388d7f
test(ext/http): add test for incomplete HTTP message and fix resource leak (#11717)
This commit adds a test case for "Http: connection closed before
message completed" error as well as fixing an edge with resource
leak when the error is raised.
2021-08-16 13:43:43 +02:00
Ryan Dahl
163f2ef571
fix: parse error when transpiling code with BOM (#11688)
Co-authored-by: David Sherret <dsherret@gmail.com>
2021-08-16 09:28:29 +02:00
Luca Casonato
02b23e0575
fix: don't statically type name on Deno.errors (#11715) 2021-08-15 15:17:07 +02:00
Casper Beyer
d1fe03d677
fix(test): dispatch load event before tests are run (#11708) 2021-08-15 13:54:44 +02:00
Divy Srivastava
370c5013c5
chore: move importKey tests to webcrypto_unit.ts (#11706) 2021-08-14 16:23:11 +02:00
Yusuke Tanaka
a1c5fef67f
fix(cli/lint): don't use gray in diagnostics output for visibility (#11702) 2021-08-14 15:05:07 +02:00
Casper Beyer
f90231924d
fix(cli): explicitly scan for ignore attribute in inline tests (#11647)
This commits adds "ignore" as a known attribute for Markdown 
codeblock which drops a code block early whenever it is seen 
in documentation tests.
2021-08-14 12:33:58 +02:00
Aaron O'Mullan
1d1507384b
cleanup(ext/web/BlobStore): avoid redundant Arc<Box<T>> alloc (#11693) 2021-08-14 10:27:27 +02:00
Casper Beyer
b8cfc95470
fix(cli/tools/repl): dont highlight candidate when completion is list (#11697) 2021-08-14 10:19:30 +02:00
Casper Beyer
ed19e32d98
refactor: normalize is_supported_ check naming (#11698)
Normalizes the naming of the functions used to determine 
if a path is a suitable match for the test runner and placed 
them both in the the fs_util module.
2021-08-14 10:17:21 +02:00
Casper Beyer
605f6119e9
fix(cli): retain input order of remote specifiers (#11700)
Specifier collection partitions remote specifiers in their own 
group which is appended to the collected specifiers at the 
end of the routine meaning that the input order isn't respected 
for remote specifiers.
2021-08-14 10:16:24 +02:00
Divy Srivastava
71f79097c6
fix(ext/crypto): importKey() SecurityError on non-extractable keys (#11662)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2021-08-13 23:20:44 +02:00
Leo K
0c9d6cbb2a
fix(http/ws): support multiple options in connection header (#11675)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2021-08-13 20:52:13 +02:00
Bartek Iwańczuk
2937f02f00
fix(ext/http): remove unwrap() when HTTP conn errors (#11674) 2021-08-13 12:07:05 +02:00
Casper Beyer
ebb79b28a5
refactor(cli): generalize module specifier collection (#11679) 2021-08-13 12:06:49 +02:00
Casper Beyer
293eed0ef2
test(cli): add test for test filtering (#11672) 2021-08-13 11:33:18 +02:00
Divy Srivastava
c1f97056f4
fix(ext/crypto): take a copy of keyData bytes (#11666) 2021-08-13 11:27:56 +02:00
Casper Beyer
3dff757927
fix(cli): allow specifiers of unknown media types with test command (#11652) 2021-08-12 20:10:14 +02:00
Bartek Iwańczuk
7d55e05486
fix(lint): add links to help at lint.deno.land (#11667) 2021-08-12 19:15:31 +02:00
Bartek Iwańczuk
fd94575576
test: mark run_watch test as flaky (#11668) 2021-08-12 13:51:27 +02:00
Casper Beyer
87d69d55ca
fix(test): sort file module specifiers (#11656) 2021-08-12 12:09:35 +02:00
Chris Knight
bb6473f3c2
doc: improve coverage CLI help text (#11646)
Co-authored-by: Casper Beyer <caspervonb@pm.me>
2021-08-12 10:21:38 +02:00
Ryan Dahl
cd323612fd
mark cafile tests as flaky (#11649) 2021-08-11 17:38:07 +02:00
David Sherret
15a763152f
chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00
Ryan Dahl
a0285e2eb8
Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00
Bartek Iwańczuk
3a69941151
test: reenable cafile tests (#11615) 2021-08-11 11:52:52 +02:00
David Sherret
8b97b39d8e
fix: correct spelling of certificate in --unsafely-ignore-certificate-errors warning message (#11634) 2021-08-10 12:47:44 -04:00
Bartek Iwańczuk
d82351d677
v1.13.0 2021-08-10 16:22:21 +02:00
Bartek Iwańczuk
548e466112
chore: release crates (#11628) 2021-08-10 14:19:42 +02:00
Bartek Iwańczuk
b9a8111a00
refactor: --unsafely-ignore-certificate-errors (#11629) 2021-08-10 13:19:45 +02:00
Kitson Kelly
465cf9a6fe
feat: add new esnext types (#11627) 2021-08-10 10:33:08 +02:00
Bartek Iwańczuk
453dfaa960
chore: upgrade crates (#11626) 2021-08-10 09:19:14 +02:00
Bartek Iwańczuk
162ec192b7
upgrade: rusty_v8 0.26.0 (#11625) 2021-08-10 09:13:02 +02:00
Kitson Kelly
f7e416bc7f
feat(lsp): support clients which do not support disabled code actions (#11612)
Closes: #11610
2021-08-10 09:56:34 +10: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
David Sherret
7600a456df
chore: remove windows-only compiler warning in http_util.rs (#11623) 2021-08-09 16:19:10 -04:00
TheAifam5
353a4a1af3
feat: Add --unsafely-treat-insecure-origin-as-secure flag to disable SSL verification (#11324)
This commit adds "--unsafely-treat-insecure-origin-as-secure" flag 
that allows to disable SSL verification for all domains, or specific
domains if they were passed as an argument to the flag.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-08-09 16:53:21 +02:00
Ryan Dahl
3ab50b3551
feat: support client certificates for connectTls (#11598)
Co-authored-by: Daniel Lamando <dan@danopia.net>
Co-authored-by: Erik Price <github@erikprice.net>
2021-08-09 15:55:00 +02:00
Leo K
f546f51698
fix(websocket): allow any close code for server (#11614) 2021-08-09 10:45:59 +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