Commit Graph

7252 Commits

Author SHA1 Message Date
Luca Casonato
c6cf790c28
roll cache keys 2022-04-20 16:56:32 +02:00
Luca Casonato
b115a74eee Revert "perf(http): optimize ReadableStreams backed by a resource (#14284)"
This reverts commit 57a8fc37fc.
2022-04-20 16:30:42 +02:00
Divy Srivastava
57a8fc37fc
perf(http): optimize ReadableStreams backed by a resource (#14284) 2022-04-20 18:16:44 +05:30
Naju Mancheril
3833d37b15
feat(repl): add "--eval-file" flag to execute a script file on startup (#14247)
This commit adds support for "--eval-file" in "deno repl" subcommand.

This flag can be used to pass paths or URLs to files, that will be executed
on REPL startup. All files will be executed in the same context as the REPL
(ie. as "plain old scripts", not ES modules), sharing the global scope.

This feature allows to implement custom REPLs on top of Deno's REPL.
2022-04-20 14:16:37 +02:00
David Sherret
ae479b1036
perf(fmt/lint): incremental formatting and linting (#14314) 2022-04-19 22:14:00 -04:00
Luca Casonato
803499886b
Remove the DENO_FUTURE_CHECK warning (#14320)
It has good intentions, but it is a really terrible user experience. As
such we shouldn't print this warning.
2022-04-19 17:08:23 +02:00
Divy Srivastava
1c05e41f37
perf(runtime): bypass tokio file and bump op buffer size to 64K (#14319) 2022-04-19 20:11:31 +05:30
David Sherret
3d1123f8b0
fix: --watch was losing items (#14317) 2022-04-19 10:12:30 -04:00
Nayeem Rahman
c30d95f2e3
feat(ext/web): add globalThis.reportError() (#13799) 2022-04-19 10:59:51 +02:00
David Sherret
a64e63c361
perf: move Deno.writeTextFile and like functions to Rust (#14221)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-04-18 18:00:14 -04:00
Luca Casonato
ca3b20df3c
chore: update wpt (#14313) 2022-04-18 21:17:19 +02:00
Nayeem Rahman
66fbdd2ed4
feat: Add DENO_NO_PROMPT variable (#14209)
This commit adds support for "DENO_NO_PROMPT" env
variable, that can be used instead of "--no-prompt" flag
to completely disable permission prompts.
2022-04-18 21:08:30 +02:00
David Sherret
bf804d3fff
fix(fmt): regression where some short if stmt headers being split on multiple lines (#14292)
Closes #14291
2022-04-18 14:32:16 -04:00
Nayeem Rahman
2f29673fb2
fix(cli/emit): Check JS roots with // @ts-check (#14090) 2022-04-18 16:52:26 +02:00
Bartek Iwańczuk
f52031ecdf
feat(test): skip internal stack frames for errors (#14302)
This commit changes "deno test" to filter out stack frames if it is beneficial to the user.

This is the case when there are stack frames coming from "internal" code
below frames coming from user code.

Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2022-04-18 15:22:23 +02:00
David Sherret
7919dc902d
fix(permissions): fallback to denied access if the permission prompt fails (#14235) 2022-04-18 09:00:38 -04:00
Bartek Iwańczuk
9c5928b5aa
fix: panic when trying to pledge permissions before restoring previous pledge (#14306)
This commit fixes and edge case, where testing/benching code could pledge new
permission set before restoring the previous pledge.

Appropriate panics were added and tests that assert that process is killed
in case of "recursive pledge".
2022-04-17 17:47:24 +02:00
Andreu Botella
19bb82aa40
feat(core): Add initial support for realms (#14019)
This commit adds tentative support for multiple realms in "deno_core". 

It adds the "JsRealm" API that adds methods like "JsRuntime"'s 
"handle_scope", "global_object" and "execute_script" specific to the realm.
2022-04-17 13:53:08 +02:00
Nayeem Rahman
bd6494d119
fix(cli/tools/test): Prefix test module paths with "./" (#14301) 2022-04-16 21:51:55 +02:00
Bartek Iwańczuk
5f2d9a4a22
feat(test): use structured data for JavaScript errors in tests (#14287)
This commit rewrites test runner to send structured error data from JavaScript
to Rust instead of passing strings. This will allow to customize display of errors
in test report (which will be addressed in follow up commits).
2022-04-16 19:51:12 +02:00
Feng Yu
32aaefd9ee
fix(tools/wpt): replace deprecated writeAllSync and writeAll (#14282) 2022-04-16 17:28:15 +02:00
Bartek Iwańczuk
a87be28a46
feat: Better formatting for AggregateError (#14285)
This commit adds "aggregated" field to "deno_core::JsError" that stores
instances of "JsError" recursively to properly handle "AggregateError"
formatting. Appropriate logics was added to "PrettyJsError" and
"console" API to format AggregateErrors.

Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2022-04-16 16:12:26 +02:00
Bartek Iwańczuk
0bb96cde72
refactor: update runtime code for primordial check x in y (#13642)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2022-04-16 14:09:07 +02:00
Nayeem Rahman
8b31fc23cd
refactor: Move source map lookups to core (#14274)
The following transformations gradually faced by "JsError" have all been 
moved up front to "JsError::from_v8_exception()": 

- finding the first non-"deno:" source line; 
- moving "JsError::script_resource_name" etc. into the first error stack 
in case of syntax errors; 
- source mapping "JsError::script_resource_name" etc. when wrapping 
the error even though the frame locations are source mapped earlier; 
- removing "JsError::{script_resource_name,line_number,start_column,end_column}"
entirely in favour of "js_error.frames.get(0)". 

We also no longer pass a js-side callback to "core/02_error.js" from cli. 
I avoided doing this on previous occasions because the source map lookups 
were in an awkward place.
2022-04-15 16:08:09 +02:00
David Sherret
b4af648c15
chore: release fixes based on doing the v1.20.6 release (#14289) 2022-04-15 09:39:41 -04:00
Bartek Iwańczuk
244926e83c
feat(test): format user code output (#14271)
This commit changes "deno test" to better denote user output coming
from test cases.

This is done by printing "---- output ----" and "---- output end ----"
markers if an output is produced. The output from "console" and
"Deno.core.print" is captured, as well as direct writes to "Deno.stdout"
and "Deno.stderr".

To achieve that new APIs were added to "deno_core" crate, that allow
to replace an existing resource with a different one (while keeping resource
ids intact). Resources for stdout and stderr are replaced by pipes.

Co-authored-by: David Sherret <dsherret@gmail.com>
2022-04-15 14:24:41 +02:00
David Sherret
0e4574b2e3
chore: forward v1.20.6 release commit to main (#14288) 2022-04-14 15:50:48 -04:00
Bartek Iwańczuk
f7e7f54849
chore: use lock file for tooling scripts (#14253)
This commit adds lock file for maintenance scripts in "tools/"
directory. 

The lock file is stored in "tools/deno.lock.json".
2022-04-13 18:51:16 +02:00
Bartek Iwańczuk
d52613ebab
chore: rephrase env var help (#14270) 2022-04-13 17:59:40 +02:00
Nayeem Rahman
7d50a5fd43
refactor(core/error): Clarify JsError message fields (#14269) 2022-04-13 16:41:39 +02:00
AEtheve
c03fbb3c1f
fix(test): Don't error on missing op details (#14184) 2022-04-13 14:18:12 +02:00
Bartek Iwańczuk
47e8deeaf7
chore: add info about DENO_FUTURE_CHECK env var to --help (#14267) 2022-04-13 13:59:53 +02:00
Nayeem Rahman
4d18f558e4
feat(ext/web): Add error events for event listener and timer errors (#14159)
- feat: Add handleable error event for even listener errors
- feat: Add handleable error event for setTimeout()/setInterval() errors
- feat: Add Deno.core.destructureError()
- feat: Add Deno.core.terminate()
- fix: Don't throw listener errors from dispatchEvent()
- fix: Use biased mode when selecting between mod_evaluate() and
  run_event_loop() results
2022-04-13 11:50:57 +02:00
Aaron O'Mullan
d621ce1cf0
fix(serde_v8): more robust number deserialization (#14216)
Fixes #14128
2022-04-12 14:36:21 +02:00
Bartek Iwańczuk
c8313a7457
feat(test): Improve testing report output (#14255)
Following changes were done in this commit:

- remove "test" prefix before each test
- use gray color for "running N tests from ..." prompt
- use relative path or remote URL instead of full URL in "running N tests from ..." prompt
- in "failures" section, add file path/remote URL before the test name

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2022-04-11 18:27:17 +02:00
Bartek Iwańczuk
c154ac5168
chore: use local copy of std in tools/bench/ scripts (#14251) 2022-04-11 11:46:23 +02:00
Ryan Dahl
1892612438
refactor: improve help text (#14249) 2022-04-11 01:01:02 -04:00
Bartek Iwańczuk
8ae17026cb
feat: Add "deno check" subcommand for type checking (#14072)
This commit adds new "deno check" subcommand.
Currently it is an alias for "deno cache" with the difference that remote
modules don't emit TS diagnostics by default.

Prints warning for "deno run" subcommand if "--check" flag is not present
and there's no "--no-check" flag. Adds "DENO_FUTURE_CHECK" env
variable that allows to opt into new behavior now.
2022-04-11 01:12:51 +02:00
David Sherret
a4eee007ef
chore: update release instructions based on 1.20.5 release (#14239) 2022-04-08 12:32:25 -04:00
David Sherret
a4c1e1bdcf
fix: upgrade to swc_ecmascript 0.143 (#14238) 2022-04-08 12:31:47 -04:00
Arthur Lafrance
e411747e24
feat(repl): Don't type check when importing modules (#14112) 2022-04-08 13:51:01 +02:00
Aaron O'Mullan
f5f7b56aca
refactor(core): OpCtx (#14228) 2022-04-08 10:32:48 +02:00
David Sherret
b2aaf708ab
chore: forward v1.20.5 release commit to main (#14232) 2022-04-07 14:40:20 -04:00
EduM22
181e378032
fix(ext/crypto): check extractable in exportKey (#14222) 2022-04-07 18:28:56 +05:30
Valentin Anger
b8d66a683a
fix(cli/install): preserve compat flag (#14223) 2022-04-06 16:54:12 -04:00
Yongwook Choi
0df1854249
feat(test): Add "name", "origin" and "parent" to "Deno.TestContext" (#14007)
This commit adds following fields to "Deno.TestContext" interface:
- name
- origin
- parent

These are prerequisites for supporting snapshot functionality in
"std/testing".
2022-04-06 16:51:38 +02:00
David Sherret
e33329b47e
chore(ci): automatically open PR to forward patch release back to main (#14180) 2022-04-04 14:56:29 -04:00
David Sherret
fcd986875a
chore(ci): update deno_std release steps (#14178) 2022-04-04 09:37:54 -04:00
Divy Srivastava
995d1666ff
chore(ext/websocket): custom arity (#14202) 2022-04-04 15:19:50 +05:30
Divy Srivastava
cc49b5e0d8
chore(ext/http): custom arity (#14200) 2022-04-04 15:19:35 +05:30