1
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
Trivikram Kamat
ffe12aa92d
chore: bump TypeScript to 4.1.4 (#9459) 2021-02-09 23:27:38 +01:00
Nayeem Rahman
900953a65a
fix(op_crates): Don't use Deno.inspect in op crates (#9332)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2021-02-09 16:31:46 +01:00
Luca Casonato
a195c75033
chore: update dependencies (#9455) 2021-02-09 15:34:34 +01:00
Kitson Kelly
d95666cae0
fix(lsp): handle code lenses for non-documents (#9454) 2021-02-09 20:48:53 +11:00
Kitson Kelly
97d5ef2950
fix(cli): import maps handles data URLs (#9437)
Fixes #9420
2021-02-09 15:05:37 +11:00
Casper Beyer
36e9e53b37
refactor(cli/tools/repl): merge highlighter into helper (#9448) 2021-02-08 17:25:10 +01:00
Kitson Kelly
1f9e9002d5
fix(lsp): prepare diagnostics when the config changes (#9438) 2021-02-08 21:45:46 +11:00
Kitson Kelly
e368c5d0f9
feat(lsp): add implementations code lens (#9441) 2021-02-08 21:45:10 +11:00
Kitson Kelly
09b79463d7 feat(lsp): add asset cache regression test
When we migrated away from all the locks, there was a regression that
was not caught immediately. The tsc::get_asset() would attempt to modify
the snapshot, but the problem was that the snapshot was a .clone() of
the inner language server's assets, which meant that modifications to
that where lost. When we then attempted to do a hover on those assets,
the inner language servers assets didn't have the retrieved asset, and
therefore would throw an error.
2021-02-08 10:47:32 +01:00
Ben Noordhuis
ccbaedb138 fix(lsp): DRY asset cache lookup logic 2021-02-08 10:47:32 +01:00
Ben Noordhuis
e7a7bf8a79 fix(lsp): fix asset cache lookup regression
Commit 2828690fc ("fix(lsp): fix deadlocks, use one big mutex") from
last month introduced a regression in asset cache lookups where results
of lazy caching were lost due to operating on a copy of the asset cache.

This commit fixes that by copying the asset from the copy to the real
cache.
2021-02-08 10:47:32 +01:00
Ben Noordhuis
be10db10fd fix(lsp): remove Sources mutex
The mutex was used to hide the fact that the Sources object mutates
itself when it's queried. Be honest about that and mark everything that
directly or indirectly mutates it as `mut`.

This is a follow-up to commit 2828690fc7
from last month ("fix(lsp): fix deadlocks, use one big mutex (#9271)")
2021-02-08 10:47:32 +01:00
Nayeem Rahman
0cac243a83
fix(cli): check for inline source maps before external ones (#9394)
Fixes #6965
2021-02-08 10:14:05 +11:00
Kitson Kelly
b6353672f8
fix(lsp): support codeAction/resolve (#9405) 2021-02-06 07:10:53 +11:00
Bartek Iwańczuk
ae10219f59
v1.7.2 2021-02-05 19:37:27 +01:00
Bartek Iwańczuk
64f06be0eb
chore: release crates (#9410) 2021-02-05 15:08:18 +01:00
Casper Beyer
c83e261b42
fix(repl): prevent symbol completion panic (#9400) 2021-02-05 12:09:52 +01:00
Kitson Kelly
5b9376908a
fix(cli/lsp): fix using jsx/tsx when not emitting via tsc (#9407)
Closes #9308
Closes #9023
Closes #8993
2021-02-05 22:01:48 +11:00
Kitson Kelly
b77fcbc518
feat(lsp): add TS quick fix code actions (#9396) 2021-02-05 05:53:02 +11:00
Ryan Dahl
644a7ff2d7
fetch optimizations (#9402)
Release deno_fetch 0.20.2
2021-02-04 13:08:41 -05:00
Bartek Iwańczuk
79fa7e0e96
docs: update example for Deno.Process (#9390) 2021-02-04 13:09:00 +01:00
Bartek Iwańczuk
9069632216
chore: upgrade swc (#9374) 2021-02-03 11:54:53 +01:00
Ben Noordhuis
fb358380c0
fix: improve http client builder error message (#9380)
Include the lower-level error message in the generic error message.

No test because I can't actually make it fail by passing it bad PEM.
I checked and `reqwest::Certificate::from_pem()` always returns `Ok()`.

Fixes #9364.
2021-02-03 11:40:43 +01:00
Casper Beyer
6abf126c2a
chore: remove std directory (#9361)
This removes the std folder from the tree.

Various parts of the tests are pretty tightly dependent 
on std (47 direct imports and 75 indirect imports, not 
counting the cli tests that use them as fixtures) so I've 
added std as a submodule for now.
2021-02-02 12:05:46 +01:00
Bartek Iwańczuk
a2b5d44f1a
refactor: Reorganise integration tests (#9282)
This commit reorganises cli/tests/integration_tests.rs.

All integration tests had been moved into integration module,
which allows to run only integration tests by "cargo test integration".

Additionally some tests were further grouped under nested modules
like "inspector", "file_watcher" or "repl".
2021-02-01 19:09:25 +01:00
Yusuke Tanaka
84f8b87f1b
chore: make all tests annotated with #[cfg(test)] (#9347) 2021-02-01 10:55:23 -05:00
Yoshiya Hinosawa
23281be33a
fix(cli): fix handling of non-normalized specifier (#9357) 2021-02-01 17:02:02 +09:00
Kitson Kelly
534531e4dd
feat(lsp): add references code lens (#9316) 2021-02-01 14:30:41 +11:00
Yusuke Tanaka
ef46bc88bd
chore: upgrade tokio to 1.1.1 (#9327) 2021-01-29 21:18:31 -05:00
Casper Beyer
9965fc8cc3
fix(cli/coverage): display mapped instrumentation line counts (#9310) 2021-01-29 14:45:22 -05:00
hvithrafn
013b8fe606
Update lspower dependency (#9179) 2021-01-29 14:34:33 -05:00
Ryan Dahl
11dd6f2013
v1.7.1 2021-01-29 09:53:03 -05:00
Bartek Iwańczuk
4b92eef25e
test: fix lock_write_fetch test (#9318) 2021-01-29 14:23:02 +01:00
Nayeem Rahman
daad575825
fix(cli): Move WorkerOptions::deno types to unstable (#9163) 2021-01-29 08:15:59 -05:00
Nayeem Rahman
f3122442db
fix(op_crates/web): Add customInspect for Location (#9290) 2021-01-29 08:08:22 -05:00
Bert Belder
98878bd812
refactor: IO resource types, fix concurrent read/write and graceful close (#9118)
Fixes: 9032.
2021-01-29 01:35:07 -08:00
Bartek Iwańczuk
c8a5e3c1e4
chore: reenable watch tests (#9306) 2021-01-29 10:34:00 +01:00
Yoshiya Hinosawa
fc162162a1
fix(cli): fix panic in Deno.emit (#9302) 2021-01-29 10:33:58 +09:00
Luca Casonato
6ecc86cf2a
chore: add jsdoc to 26_fetch.js and enable some fetch tests (#9305) 2021-01-28 21:37:21 +01:00
Kitson Kelly
7bda0f567e
fix(cli): add lib dom.asynciterable (#9288)
Fixes #9218
2021-01-29 06:41:30 +11:00
Casper Beyer
5cf194380b
fix(coverage): use source maps when printing pretty reports (#9278)
This commits makes use of source maps and the original source 
when printing lacking line coverage in the pretty printer.

Only the executable lines are checked as before (as non-executable 
lines will always be ignored anyways). The lines then mapped to the 
appropriate source line when a source map is present.
2021-01-28 15:11:38 +01:00
William Perron
f858b653be
bench: remove custom error types (#9301)
Fixes #9253
2021-01-27 22:50:14 -05:00
Kitson Kelly
894ff6bb58
fix(cli): early abort before type checking on missing modules (#9285)
Fixes #9275
2021-01-28 06:54:20 +11:00
Luca Casonato
2638aa03a5
tests: new typescript WPT runner (#9269) 2021-01-27 15:06:18 +01:00
Kitson Kelly
ecfda65eff
fix(cli): correctly determine emit state with redirects (#9287)
Fixes #9129
2021-01-27 22:25:33 +11:00
Ikko Ashimine
798027a596
chore: fix typo in lint.rs (#9281) 2021-01-27 14:41:48 +11:00
Kitson Kelly
e7323002d9
feat(lsp): add performance measurements (#9209) 2021-01-27 11:32:49 +11:00
Kitson Kelly
ada43cc56a
fix(lsp): handle mbc properly when formatting (#9273) 2021-01-27 07:50:13 +11:00
akfm
43f4a23f89
fix(cli): fmt command help message (#9280) 2021-01-26 21:01:10 +01:00
Luca Casonato
40fc5f55ea
chore: update crates (#9251)
Updates SWC, dprint, deno_lint, deno_doc, serde, and Tokio (to 1.1.0).

Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-01-26 17:00:40 +01:00
Kitson Kelly
f9949a3170
fix(op_crates/fetch): fix ReadableStream.pipeThrough() (#9265)
Fixes #9252
2021-01-26 21:56:29 +11:00
Kitson Kelly
8b6893438a
fix(lsp): complete list of unused diagnostics (#9274) 2021-01-26 21:55:59 +11:00
Ben Noordhuis
2828690fc7
fix(lsp): fix deadlocks, use one big mutex (#9271)
The LSP code had numerous places where competing threads could take out
out locks in different orders, making it very prone to deadlocks.
This commit sidesteps the entire issue by switching to a single lock.

The above is a little white lie: the Sources struct still uses a mutex
internally to avoid having to boil the ocean (because being honest about
what it does involves changing all its methods to `&mut self` but that
ripples out extensively...) I'll save that one for another day.
2021-01-26 10:55:04 +01:00
Kitson Kelly
2b4e0be43c
fix(lsp): reduce deadlocks with in memory documents (#9259) 2021-01-26 10:47:12 +11:00
Luca Casonato
e0eb111e3e
Revert "tests: enable wpt for url (#9046)" (#9264)
This reverts commit 66e99d349b.
2021-01-25 16:02:03 +01:00
akfm
cf688cb408
docs(cli): fix return type in comment (#9248) 2021-01-25 15:14:25 +09:00
Luca Casonato
66e99d349b
tests: enable wpt for url (#9046) 2021-01-24 22:29:36 +01:00
ali ahmed
feff6361b1
feat(op_crates/web): adding gb18030 and GBK encodings (#9242) 2021-01-24 20:08:01 +01:00
Anonymous
ad60e750d7
fix(runtime/js): use DOMException in Performance#measure (#9142) 2021-01-24 16:05:18 +01:00
akfm
2ca637962f
docs(cli): fix typo stanalone -> standalone (#9246) 2021-01-24 14:25:18 +01:00
Nayeem Rahman
452df2f23a
fix(cli/flags): don't panic on invalid location scheme (#9202) 2021-01-24 02:18:19 +01:00
Liam Murphy
a61389a55e
fix(compile): fix panic when cross-compiling between windows and unix (#9203) 2021-01-24 02:40:13 +09:00
Kitson Kelly
1a9209d1e3
fix(lsp): handle mbc documents properly (#9151)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2021-01-22 21:03:16 +11:00
Nayeem Rahman
bdb1ee6480
fix(core): Handle prepareStackTrace() throws (#9211)
Fixes #9206
2021-01-21 20:48:04 +11:00
Yoshiya Hinosawa
18ac7d40c8
fix(runtime): fix recursive dispatches of unload event (#9207) 2021-01-21 16:44:48 +09:00
Casper Beyer
413f79a494
fix(coverage): ignore comments (#8639)
This commit fixes coverage collection by ignoring
comments when tallying up line counts.
2021-01-20 15:51:36 +01:00
Yoshiya Hinosawa
0a159bea15
fix(ops/net): fix panic in op_dns_resolve (#9187) 2021-01-20 15:47:17 +01:00
Ryan Dahl
bfaa121cd2
v1.7.0 2021-01-19 23:17:20 -05:00
Bert Belder
b0132e8f90
fix(cli): actually stabilize Deno.shutdown() (#9181) 2021-01-19 20:11:08 -08:00
Kitson Kelly
02c6a88d8a
docs: improve manual around typescript (#8139)
Fixes #9054
2021-01-20 09:28:58 +11:00
ali ahmed
973c33c899
feat(web): add utf-16 and big5 to TextEncoder/TextDecoder (#8108) 2021-01-19 21:58:57 +01:00
Luca Casonato
0e8e6d7251
chore: add compile aarch64-apple-darwin target (#9174) 2021-01-19 20:03:50 +01:00
Satya Rohith
16036a8a51 feat: add markdown support to deno fmt (#8887)
This commit adds support for formatting markdown files with "deno fmt".

Additionally "--ext={js|jsx|ts|tsx|md}" flag was added to "deno fmt"
that allows to specify file type when providing contents over stdio.
2021-01-19 18:39:35 +01:00
Luca Casonato
4c223d0521
fix: panic during deno compile with no args (#9167) 2021-01-19 16:19:36 +01:00
Yusuke Tanaka
0ef8c915c0
feat(unstable): add Deno.resolveDns API (#8790) 2021-01-19 09:39:04 -05:00
Luca Casonato
cf3202644d
fix: full commit hash in canary compile download (#9166) 2021-01-19 13:53:23 +01:00
Freddy Fallon
867ce78fb6
fix(installer): pass cached-only to executable_args (#9169) 2021-01-19 13:46:08 +01:00
Liam Murphy
3505823e20
fix(cli/install): escape % symbols in windows batch files (#9133)
Fixes #9096.
2021-01-18 19:34:37 -08:00
Bartek Iwańczuk
9ff468df73
feat: Standalone lite binaries and cross compilation (#9141)
This commit adds --target and --lite flags to deno compile subcommand.

--target allows to cross-compile binary to different target architectures by
fetching appropriate binary from remote server on first run. All downloaded
binaries are stored in "$DENO_DIR/dl".

--lite allows to use lite version of the runtime (ie. the one that doesn't contain
built-in tooling like formatter or linter).
2021-01-19 03:40:22 +01:00
Nayeem Rahman
b12afdb89a
feat: Add WorkerOptions interface to type declarations (#9147) 2021-01-19 03:26:39 +01:00
Casper Beyer
f43855cead
fix(cli): print a newline after help and version (#9158) 2021-01-19 01:56:24 +01:00
Luca Casonato
7a30d1a3d8
fix: redirect in --location relative fetch (#9150) 2021-01-18 13:59:29 +01:00
William Perron
18150b3a78
bench: fix off-by-one error in thread_count (#9145) 2021-01-18 05:00:51 -05:00
Kitson Kelly
2077864a8d
fix(op_crate/fetch): add back ReadableStream.getIterator and deprecate (#9146) 2021-01-18 10:40:39 +11:00
Nayeem Rahman
81d73f2987
fix(cli): Check permissions for Deno.emit() (#9139) 2021-01-18 08:58:23 +11:00
William Perron
2b5b93158c
benchmark: cleanup serde_json values being passed around (#9115) 2021-01-17 11:40:29 -05:00
Vishal Pratap Singh
271fbe39e3
tests(wpt): enable working wasm tests (#9072) 2021-01-17 16:46:33 +01:00
Nayeem Rahman
7db0605d45
fix(op_crates/web): Use WorkerLocation for location in workers (#9084) 2021-01-17 16:28:54 +01:00
Bartek Iwańczuk
f4dbb267c6
fix: incremental build for deno declaration files (#9138) 2021-01-17 15:12:00 +01:00
Bartek Iwańczuk
b26dcbc69d
chore: Enforce ban-untagged-todo lint rule (#9135) 2021-01-17 00:32:59 +01:00
linbingquan
fc45a19801
docs(cli): correct example (#9136) 2021-01-17 10:31:29 +11:00
Bartek Iwańczuk
69fb2b31b3
upgrade: dlint in third_party/ (#9134) 2021-01-16 16:09:11 +01:00
Hirochika Matsumoto
4b2df87c54
refactor(lsp): don't duplicate fields present in DocumentSpan (#9131) 2021-01-16 13:00:42 +01:00
Bartek Iwańczuk
a3007de950
upgrade: deno_lint to 0.2.16 (#9127) 2021-01-15 19:20:01 +01:00
Kitson Kelly
b8303c7812
refactor(op_crate/fetch): align streams to spec (#9103)
Fixes #8814
2021-01-15 08:57:19 +11:00
Steven Guerrero
2d1208556a
fix: don't swallow customInspect exceptions (#9095) 2021-01-14 14:18:51 -05:00
Bert Belder
979d71c883 refactor: make Process#kill() throw sensible errors on Windows (#9111)
Previously, calling `Process#kill()` after the process had exited would
sometimes throw a `TypeError` on Windows. After this patch, it will
throw `NotFound` instead, just like other platforms.

This patch also fixes flakiness of the `runKillAfterStatus` test on
Windows.
2021-01-14 10:26:59 -08:00
Yoshiya Hinosawa
c75f92c4e2
fix: align DOMException API to the spec and add web platform testing of it. (#9106)
* fix: align DOMException API to the spec

* test: fix test case 070_location

* test(DOMException): disable "does not inherit from Error: class-side"
test of WPT

* test: remove test cases in deno codebase

* docs: add note about skipped test
2021-01-14 22:08:49 +09:00
Bert Belder
78c27e0923
Merge pull request #9107
Bump crate versions and publish crates.
2021-01-13 11:44:31 -08:00
Ryan Dahl
8fc29f224d release crates 2021-01-13 14:00:13 -05:00
Bert Belder
060bfe7df8
Fix race condition in file watcher (#9105) 2021-01-13 10:55:44 -08:00
Bert Belder
ca07bab594
Remove unnecessary boxing of tokio::time::Sleep (#9105) 2021-01-13 10:55:28 -08:00
Luca Casonato
18b3150401
build: disable cafile_* tests and use slow runners (#9089) 2021-01-13 16:48:33 +01:00
Luca Casonato
1728b3ba19
tests: disable logging of 'ok' web platform tests (#9087) 2021-01-12 17:14:17 -08:00
Bartek Iwańczuk
8142496c57
feat: stabilize Deno.shutdown() and Conn#closeWrite()
Closes: #9099
2021-01-12 16:17:31 -08:00
Hirochika Matsumoto
8d5af6ca52
feat(lsp): Add textDocument/implementation (#9071)
Ref #8643
2021-01-13 08:53:27 +11:00
Yacine Hmito
46a072c792
tests: enable .worker.js tests (#9065) 2021-01-12 14:02:13 +01:00
Bert Belder
de0ae3a12c
fix(installer): remove redundant clone (#9098) 2021-01-12 13:55:09 +01:00
Yoshiya Hinosawa
fd56fa89f3
fix(cli): dispatch unload on exit (#9088) 2021-01-12 05:32:58 -05:00
Yusuke Tanaka
5c6ab75de1
fix(watcher): keep working even when imported file has invalid syntax (#9091) 2021-01-11 23:53:58 -08:00
Bartek Iwańczuk
275a5c65a2
upgrade: tokio 1.0 (#8779)
Co-authored-by: Bert Belder <bertbelder@gmail.com>
2021-01-11 23:50:02 -08:00
Yusuke Tanaka
d8fd71afdf
chore: update copyright to 2021 (#9092) 2021-01-11 18:13:41 +01:00
Bartek Iwańczuk
d676b6c63a
upgrade: swc_bundler 0.19.2 (#9085) 2021-01-11 15:32:34 +01:00
gorogoroumaru
b0821fe9ce
fix(op_crate/web): fix atob to throw spec aligned DOMException (#8798) 2021-01-11 09:15:32 +11:00
Luca Casonato
1a6ce29f3d
feat(fetch): req streaming + 0-copy resp streaming (#9036)
* feat(fetch): req streaming + 0-copy resp streaming

* lint

* lint

* fix test

* rm test.js

* explicitly use CancelHandle::default()

* Apply review suggestions

Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>

* fix test

* Merge remote-tracking branch 'origin/master' into fetch_real_streaming

* fix test

* retrigger ci

Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
2021-01-10 20:54:29 +01:00
Tarik Eshaq
9801858cb0
tests(wpt/console): Enables web platform tests for console (#9013) 2021-01-10 12:49:45 -05:00
Yacine Hmito
f7e09c6a55
Test crypto.getRandomValues() with wpt (#9016) 2021-01-10 11:27:15 -05:00
Ryan Dahl
ab5ecabe22
Add cargo_deps to benchmarks (#9075) 2021-01-10 08:13:38 -05:00
Luca Casonato
4361895476
fix: don't error on version and help flag (#9064) 2021-01-09 13:08:03 +01:00
Casper Beyer
6d7da6309e
tests: enable WPT for timers (#9047) 2021-01-09 07:32:04 +01:00
Yacine Hmito
9637209765
fix(web): implement DOMException#code (#9015)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-01-09 07:27:46 +01:00
Bert Belder
f3ead9c6a7
refactor: Print cause chain when downcasting AnyError fails (#9059) 2021-01-09 01:57:37 +01:00
yonatan ben avraham
5f015eac9c
fix: Worker hangs when posting "undefined" as message (#8920)
This commit fixes hang in web workers occuring when sending
"undefined" as message value. It is a temporary band-aid
until proper structured close is implemented.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-01-08 15:44:24 +01:00
Luca Casonato
a44349dfdf
feat: denort binary (#9041)
This commit adds new binary target called "denort".

It is a "lite" version of "deno" binary that can only execute
code embedded inside the binary itself.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-01-08 03:08:51 +01:00
Nayeem Rahman
e61e81eb57
feat: add --location=<href> and globalThis.location (#7369) 2021-01-07 19:06:08 +01:00
Anonymous
b40d5e5e0b
ignore "use asm" (#9019)
Preventing V8 from logging erroneous line numbers. Use wasm.
2021-01-07 10:50:57 -05:00
Casper Beyer
9b3338fa2f
fix(coverage): report partial lines as uncovered (#9033) 2021-01-07 12:45:42 +01:00
Casper Beyer
f8df9938c5
fix(coverage): do not store source inline in raw reports (#9025)
When we were doing single process in-memory reports getting the source
from the runtime was practical, but now that we're writing to disk this
conflicts with the format tools taking raw v8 coverage dumps expect.
2021-01-07 05:53:57 -05:00
Nayeem Rahman
b5f1d257a3
fix: Use "none" instead of false to sandbox Workers (#9034) 2021-01-07 05:52:30 -05:00
Ryan Dahl
cb658f5ce5
Remove emoji from welcome script so it looks better on windows (#9031) 2021-01-07 05:51:15 -05:00
Steven Guerrero
adc2f08c17
feat: Add configurable permissions for Workers (#8215)
This commit adds new option to "Worker" Web API that allows to 
configure permissions.

New "Worker.deno.permissions" option can be used to define limited
permissions to the worker thread by either:
- inherit set of parent thread permissions
- use limited subset of parent thread permissions
- revoke all permissions (full sandbox)

In order to achieve this functionality "CliModuleLoader"
was modified to accept "initial permissions", which are used
for top module loading (ie. uses parent thread permission set
to load top level module of a worker).
2021-01-06 21:31:16 +01:00
Luca Casonato
2e18fcebcc
refactor: move WebSocket API to an op_crate (#9026) 2021-01-06 16:57:28 +01:00
Anonymous
3761d054d0
fix: stronger input checking for setTimeout; add function overload (#8957) 2021-01-06 08:53:30 -05:00
Kitson Kelly
54240c22af
feat(cli): support data urls (#8866)
Closes: #5059

Co-authored-by: Valentin Anger <syrupthinker@gryphno.de>
2021-01-06 13:22:38 +11:00
Luca Casonato
60c9c85758
fix: align performance API to spec using WPT (#9012) 2021-01-06 02:56:40 +01:00
Bartek Iwańczuk
bb88418221
refactor(cli): remove 'js' module, simplify compiler snapshot (#9020)
This commit removes "js" module from "cli".

It contained stuff related to TypeScript compiler (snapshot,
declaration files) and thus it was moved to "tsc" module.
2021-01-06 02:38:23 +01:00
Luca Casonato
39bbbbce70
fix: use inline source maps when present in js (#8995) 2021-01-06 00:10:36 +01:00
Bartek Iwańczuk
8d1ee3bfaf
upgrade: deno_doc, deno_lint, dprint, swc_ecmascript, swc_bundler (#9003) 2021-01-05 22:51:54 +01:00
Luca Casonato
7704839039
fix: align AbortSignal to spec using WPT (#9007) 2021-01-05 22:43:25 +01:00
Ryan Dahl
096e090576
Add rlib size benchmarks (#9005) 2021-01-05 16:28:51 -05:00
Bartek Iwańczuk
46c0cab763
refactor(core): simplify Deno.core initialisation, remove stale TODO (#8847)
This commit rewrites initialisation of the "shared queue" and
in effect prevents from double execution of "core/core.js" and
"core/error.js".

Previously both of these files were executed every time a "JsRuntime"
was created. That lead to a situation where one copy of each script
was included in the snapshot and then another copy would be
executed after loading the snapshot.

Effectively "JsRuntime::shared_init" was removed; instead execution
of those scripts and actual initialisation of shared queue
was split into two helper functions: "JsRuntime::js_init" and
"JsRuntime::share_queue_init".

Additionally stale TODO comments were removed.
2021-01-05 22:10:50 +01:00
Luca Casonato
0d41e21b0e
fix: align encoding APIs to spec using WPT (#9004) 2021-01-05 19:50:40 +01:00
Luca Casonato
a3099798c8
tests: add web platform test runner (#8990)
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-01-05 12:07:27 +01:00
Nayeem Rahman
cbc2108525
feat(cli/standalone): support runtime flags for deno compile (#8738) 2021-01-05 00:15:52 +01:00
Valentin Anger
444eca80a9
fix(lsp): Respect client capabilities for config and dynamic registration (#8865) 2021-01-05 08:52:20 +11:00
Sylvain Cau
b478b06f9d
feat(installer): Add support for MSYS on Windows (#8932) 2021-01-04 08:52:43 -08:00
Casper Beyer
4ca77ad84c
fix(coverage): merge duplicate reports (#8942)
Merging multiple runs isn't quite right because we 
rely on a 0 count to signal that a block hasn't been called.

Other tools like c8 expect this to be true as-well so we 
need to do our best to merge coverage files rather 
than duplicating them.
2021-01-04 17:01:21 +01:00
Mo
3e5a3daf59
BREAKING(unstable): remove CreateHttpClientOptions.caFile (#8928) 2021-01-04 16:55:20 +01:00
Satya Rohith
1d4f8298a7
docs: meta updates to cli/tests/unit/README.md (#8969) 2021-01-04 15:55:57 +01:00
Ben Noordhuis
20babd9bfa
fix(inspector): kill child process after test (#8986)
The child process kept running and printing "hello" to stdout.

This commit also removes the dependency on reqwest and instead
switches to the re-export from the fetch crate.

Brings back commit 1a2e7741c3.
2021-01-04 15:52:22 +01:00
Bartek Iwańczuk
f4246ee1fc
chore: disable flaky test on Windows (#8987) 2021-01-04 14:27:29 +01:00
Luca Casonato
379eedc05c
Revert "fix(inspector): add back list endpoint (#8894)" (#8977)
This reverts commit 1a2e7741c3.
2021-01-04 12:19:23 +01:00
Maayan Hanin
1a6969bebb
fix: panic on invalid file:// module specifier (#8964) 2021-01-04 04:33:20 -05:00
Liam Perlaki
1a2e7741c3
fix(inspector): add back list endpoint (#8894)
This commit adds back "/json/list" endpoint to
inspector server which was erroneously removed
during server rewrite.
 
Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
2021-01-03 21:31:52 +01:00
Bartek Iwańczuk
41a4a34aee
upgrade: Rust 1.49.0 (#8955) 2021-01-02 13:52:42 +01:00
Kitson Kelly
012f99bd9a
refactor(cli): runtime compiler APIs consolidated to Deno.emit() (#8799)
Closes: #4752
2021-01-01 08:43:54 +11:00
Kitson Kelly
587155f86d
feat(lsp): support specifying a tsconfig file (#8926) 2020-12-31 14:33:44 +11:00
Rich Trott
e568ddf996
fix(op_crates/fetch): correct regexp for fetch header (#8927)
Fix bug in regular expression and make the regular expression more
strict.

In a string passed to new RegExp(), '[\t\s]' is identical to '[ts]' and
not `/[\t\s]/`. For that, the backslash needs to be escaped in the
string. Futhermore, `\t` is the tab character and is included in the
special regexp value `\s` so is unnecessary.

That would reduce the RegExp to new RegExp(`^${value}\\s*;?`) but
there's no point in matching 0 or more space characters followed by 0 or
one semi-colons as that will match no matter what follows `value`.

To make it more strict, require one of space, semicolon, or
end-of-string after value.
2020-12-30 23:46:08 +01:00
Nayeem Rahman
22e0ee92a6
BREAKING(unstable): Use hosts for net allowlists (#8845)
Allowlist checking already uses hosts but for some reason 
requests, revokes and the runtime permissions API use URLs.

- BREAKING(lib.deno.unstable.d.ts): Change 
NetPermissionDescriptor::url to NetPermissionDescriptor::host

- fix(runtime/permissions): Don't add whole URLs to the 
allowlist on request

- fix(runtime/permissions): Harden strength semantics:
({ name: "net", host: "127.0.0.1" } is stronger than 
{ name: "net", host: "127.0.0.1:8000" }) for blocklisting

- refactor(runtime/permissions): Use tuples for hosts, make 
the host optional in Permissions::{query_net, request_net, revoke_net}()
2020-12-30 23:35:28 +01:00
Rich Trott
af222f7a7f
chore(cli/tests): fix typo in test failure message (#8935) 2020-12-30 11:00:55 -05:00
Bartek Iwańczuk
b07a0b640d
v1.6.3 2020-12-30 16:13:42 +01:00
Bartek Iwańczuk
4997f426c3
chore: release crates (#8931) 2020-12-30 15:29:17 +01:00
Kitson Kelly
b1230a85e8
fix(cli): info does not panic on missing modules (#8924)
Fixes #8918
2020-12-30 22:19:51 +11:00
Kitson Kelly
8011eced14
feat(lsp): add cache command (#8911) 2020-12-30 15:17:17 +11:00
Kitson Kelly
e8a81724bb
fix(lsp): handle ts debug errors better (#8914)
Fixes #8864
2020-12-30 12:46:58 +11:00
hrsh7th
57b0562957
feat(lsp): Implement textDocument/rename (#8910) 2020-12-30 11:58:20 +11:00
Yusuke Tanaka
d5f3a749eb
refactor(cli/flags): change allow_read/write/net types from bool to Option<Vec<T>> (#8896)
This PR refactors "cli/flags.rs" and "runtime/permissions.rs" so 
that "allow_read", "allow_write" and "allow_net" themselves
have allowlists, instead of storing them in additional fields.
2020-12-29 19:34:35 +01:00
Deepanshu Utkarsh
115de4c81a
fix(core): Fix incorrect index in Promise.all error reporting (#8913) 2020-12-29 15:24:19 +01:00
Bartek Iwańczuk
24844a0052
upgrade: dprint, swc_bundler, swc_common, swc_ecmascript (#8901) 2020-12-29 00:22:36 +01:00
Waldir Pimenta
b778f8bbff
docs(introduction): Improve wording and capitalization (#8848) 2020-12-29 10:05:29 +11:00
Casper Beyer
091059450e
feat(unstable): collect coverage from the run command (#8893)
This adds implicit coverage collection to the run command 
when a coverage collection directory is set (via an environment 
variable).
2020-12-28 16:51:26 +01:00
Luca Casonato
9419c06ab5
chore: move ProgressEvent type to deno.web lib (#8878) 2020-12-26 18:15:30 +01:00
Casper Beyer
e8587c86bf
test(cli): ensure await Promise.all does not race (#8868) 2020-12-26 08:29:46 -05:00
Yosi Pramajaya
c1fdb30394
fix: fetch bad URL will not panic (#8884) 2020-12-26 08:06:00 -05:00
Yosi Pramajaya
b15539587e
refactor(test_util): replace "warp" with "hyper" (#8846)
This commit rewrites "test_server" to use "hyper" 
instead of "warp" in an effort to reduce number of
dependencies.
2020-12-24 14:11:32 +01:00
Kitson Kelly
a4d557126e
fix(lsp): provide diagnostics for unresolved modules (#8872) 2020-12-24 21:53:03 +11:00
Bartek Iwańczuk
d199e45ad5
v1.6.2 2020-12-22 17:00:35 +01:00
Bartek Iwańczuk
6ce310fa27
chore: release crates (#8854) 2020-12-22 14:50:13 +01:00
Luca Casonato
ddda669a02
fix: implement ReadableStream fetch body handling (#8855) 2020-12-22 14:14:23 +01:00
Kitson Kelly
097c3379ba
feat(lsp): support the unstable setting (#8851) 2020-12-22 21:21:18 +11:00
Kitson Kelly
b091c6c8c9
fix(lsp): respect enable flag for requests (#8850) 2020-12-22 16:42:32 +11:00
Bartek Iwańczuk
1e144ec022
upgrade: deno_doc, deno_lint, dprint, swc (#8849) 2020-12-22 00:57:03 +01:00
Liam Murphy
4033b39036
refactor: rewrite chown_test.ts not to depend on python (#8843)
This commit rewrites "chown_test.ts" to use the GNU "id" command 
instead of python. This won't work on Windows, but these tests aren't
currently run on Windows anyway.
2020-12-21 16:30:59 +01:00
Luca Casonato
bd85d0ed42
refactor: rewrite lsp to be async (#8727)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2020-12-21 08:44:26 -05:00
Casper Beyer
3078fcf55a
feat(unstable): record raw coverage into a directory (#8642) 2020-12-21 14:04:25 +01:00
Liam Murphy
d5ee168468
refactor: rewrite process_test.ts to use deno instead of python (#8841)
Rewrites all the subprocess python scripts to be Deno scripts.
2020-12-21 13:13:09 +01:00
Bartek Iwańczuk
3eec73ff90
Revert "fix: TLA in web worker (#8809)" (#8839)
This reverts commit e924bbdf36.
2020-12-20 15:14:19 +01:00
Bartek Iwańczuk
e924bbdf36
fix: TLA in web worker (#8809)
Implementors of `deno_core::JsRuntime` might want to do additional actions
during each turn of event loop, eg. `deno_runtime::Worker` polls inspector,
`deno_runtime::WebWorker` receives/dispatches messages from/to worker host.
Previously `JsRuntime::mod_evaluate` was implemented in such fashion that it 
only polled `JsRuntime`'s event loop. This behavior turned out to be wrong 
in the example of `WebWorker` which couldn't receive/dispatch messages because
its implementation of event loop was never called. 

This commit rewrites "mod_evaluate" to return a handle to receiver that resolves
when module's promise resolves. It is now implementors responsibility to poll
event loop after calling `mod_evaluate`.
2020-12-20 00:34:22 +01:00
Bartek Iwańczuk
660f75e066
upgrade: swc_ecmascript 0.15.1 (#8836) 2020-12-20 00:30:53 +01:00
yonatan ben avraham
afbd19ed9b
feat(unstable): support in memory certificate data for Deno.createHttpClient (#8739) 2020-12-19 23:13:48 +01:00
Bartek Iwańczuk
4ab1aa8877
upgrade: rustyline 7.1.0 (#8829) 2020-12-19 16:20:36 +01:00
Luca Casonato
b9165e9482
fix: atomically write files to $DENO_DIR (#8822) 2020-12-18 19:30:49 +01:00
Nayeem Rahman
ffb5f7a4e1
refactor: Rename runtime/rt to runtime/js (#8806) 2020-12-17 17:37:57 +01:00
Casper Beyer
55dc467b41
test(cli): ensure await all on stdout does not deadlock (#8802) 2020-12-17 15:01:47 +01:00
Trivikram Kamat
63e0ab99a1
upgrade TypeScript to 4.1.3 (#8785) 2020-12-16 11:46:32 -05:00
Bartek Iwańczuk
6984b63f2f
refactor: rewrite ops to use ResourceTable2 (#8512)
This commit migrates all ops to use new resource table
and "AsyncRefCell".

Old implementation of resource table was completely 
removed and all code referencing it was updated to use
new system.
2020-12-16 17:14:12 +01:00
Bartek Iwańczuk
9fe26f8ca1
refactor: remove dead code (#8781) 2020-12-15 21:45:29 +01:00
Kitson Kelly
892d6cc997
refactor(lsp): optimise static assets (#8771)
Fixes #8158
2020-12-16 06:34:39 +11:00
Kitson Kelly
63a821b78b
fix(cli): make dynamic import errors catchable (#8750)
Fixes #6259
2020-12-15 16:52:55 +11:00
Bartek Iwańczuk
b6d5ae1ecd
v1.6.1 2020-12-14 21:25:05 +01:00
Bartek Iwańczuk
025c0a1d37
chore: release crates (#8765) 2020-12-14 19:47:28 +01:00
Bartek Iwańczuk
a19fea918f
Revert "build: Factor out common code into core/build_util.rs (#8756)" (#8763)
This reverts commit 502c77aad9.
2020-12-14 18:42:40 +01:00
Casper Beyer
ce6b738ac0
fix(repl): recover from invalid input (#8759) 2020-12-14 11:37:08 -05:00
Bartek Iwańczuk
8f8749095c
chore: release crates (#8760) 2020-12-14 17:11:17 +01:00
Bartek Iwańczuk
3476d5434f
chore: release deno_runtime 0.2.0 (#8758) 2020-12-14 15:47:20 +01:00
Ryan Dahl
a38b6b8acc
fix: docs.rs detection (#8755) 2020-12-14 15:15:16 +01:00
Ryan Dahl
502c77aad9
build: Factor out common code into core/build_util.rs (#8756) 2020-12-14 14:28:56 +01:00
crowlKats
b2bda57073
fix(cli): show canary string in long version (#8675) 2020-12-14 13:55:07 +01:00
Bartek Iwańczuk
389f492551
chore: release crates (#8744) 2020-12-13 22:34:54 +01:00
Bartek Iwańczuk
2e74f164b6
refactor: deno_runtime crate (#8640)
This commit moves Deno JS runtime, ops, permissions and
inspector implementation to new "deno_runtime" crate located
in "runtime/" directory.

Details in "runtime/README.md".

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-12-13 19:45:53 +01:00
Yosi Pramajaya
84ef9bd21f
fix(cli/compile): error when the output path already exists (#8681) 2020-12-12 20:41:43 +01:00
Bartek Iwańczuk
623bc22ad0
Revert "chore(test): increase file watcher timeout duration on macOS (#8733)" (#8737)
This reverts commit f4cf1b4538.
2020-12-12 16:54:00 +01:00
Yusuke Tanaka
f4cf1b4538
chore(test): increase file watcher timeout duration on macOS (#8733) 2020-12-12 14:32:46 +01:00
Tatsuya Yamamoto
93cd9ab0b8
docs: fix doc to remove annotation about removed function Deno.dir (#8732) 2020-12-12 13:16:52 +01:00
Andrew Mitchell
c05615d670
docs: Remove a deprecated function from docstring for Deno.permissions (#8729) 2020-12-12 13:15:50 +01:00
Bartek Iwańczuk
31935c6b8d
refactor(cli): more options on Worker (#8724) 2020-12-12 00:36:18 +01:00
Bartek Iwańczuk
65e72b68ac
refactor(cli): decouple ops from ProgramState and Flags (#8659)
This commit does major refactor of "Worker" and "WebWorker",
in order to decouple them from "ProgramState" and "Flags".
The main points of interest are "create_main_worker()" and
"create_web_worker_callback()" functions which are responsible
for creating "Worker" and "WebWorker" in CLI context.
As a result it is now possible to factor out common "runtime"
functionality into a separate crate.
2020-12-11 18:49:26 +01:00
crowlKats
71d468bec0
fix(cli): zsh completions (#8718) 2020-12-11 13:18:30 +01:00
Anh Hong
b8bc24d167
chore: fixed various misspellings and other typos (#8691) 2020-12-11 06:45:45 +11:00
Bartek Iwańczuk
f91fa16661
refactor(core): stack trace mapping (#8660)
This commit adds "Deno.core.createPrepareStackTrace". This function
was moved from "cli/rt/40_error_stack.js" to unify handling of stack frames in core
(before this PR there was implicit dependency on logic in "core/error.rs::JsError").
Unfortunately formatting logic must still be duplicated in "cli/error.js::PrettyJsError"
to provide coloring, but currently there's no solution to this problem.
"createPrepareStackTrace" can accept a single argument; a function that takes
a location and provides source mapped location back.
2020-12-10 14:45:41 +01:00
Kitson Kelly
1a72c9ba23
fix(lsp): only resolve sources with supported schemas (#8696)
Fixes #8695
2020-12-10 11:12:46 +11:00
Luca Casonato
de65312b7f
chore: update swc_ecmascript to 0.15.0 (#8688) 2020-12-09 23:09:10 +01:00
Kitson Kelly
95a6698cac
feat(lsp): support import maps (#8683) 2020-12-10 06:50:47 +11:00
Jae-Heon Ji
d492fb0eac
fix(op_crates/fetch): support non-ascii response headers value (#8600) 2020-12-09 16:48:06 +01:00
Ryan Dahl
f15b3d84a5
Remove dead code: itest_ignore (#8668) 2020-12-08 20:29:00 -05:00
Bartek Iwańczuk
9bff85836c
fix: pull .d.ts files from js mod (#8671) 2020-12-08 16:33:50 +01:00
Bartek Iwańczuk
df87bf1d6a
v1.6.0 2020-12-08 15:37:45 +01:00
Bartek Iwańczuk
656caa2d4f
chore: release crates (#8662) 2020-12-08 13:54:19 +01:00
Luca Casonato
e94a18240e
feat(lsp): basic support for textDocument/completion (#8651) 2020-12-08 11:36:13 +01:00
Ryan Dahl
4e025fd164
Upgrade ring to support arm64 (#8658) 2020-12-07 20:12:18 -05:00
Bartek Iwańczuk
5eedcb6b8d
chore(cli): unhide lsp command from CLI (#8647) 2020-12-07 23:27:43 +01:00
Benjamin Gruenbaum
b566d184fe
refactor(cli/rt): deduplicate code (#8649) 2020-12-07 21:22:58 +01:00
Steven Guerrero
43a35b005f
perf: use minimal op with performance.now() (#8619) 2020-12-07 08:27:25 -05:00
Nayeem Rahman
b77d6cb29e
chore(std): Remove tsconfig_test.json (#8629)
Ref #8050
2020-12-07 21:49:58 +11:00
Kitson Kelly
301d3e4b68
feat: add mvp language server (#8515)
Resolves #8400
2020-12-07 21:46:39 +11:00
Bartek Iwańczuk
c8e9b2654e
refactor(cli): Simplify choosing type lib in CliModuleLoader (#8637) 2020-12-07 11:03:03 +01:00
Bartek Iwańczuk
c0ccbcdaee
refactor(cli): Reorganize worker code, use stronger memory ordering (#8638) 2020-12-07 04:30:40 +01:00
crowlKats
7135d34cca
refactor(cli): remove Option from Flags.v8_flags (#8633) 2020-12-06 18:19:21 +01:00
Bartek Iwańczuk
e6b90beb3d
upgrade: swc_bundler 0.17.5 (#8588) 2020-12-04 13:21:38 +01:00
János Veres
93d9f51d16
fix(cli): add hygiene pass to transpile pipeline (#8586)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-12-02 20:26:04 +01:00
Bartek Iwańczuk
f49d955601
fix(compile): disable source mapping of errors (#8581)
This commit disables source mapping of errors
for standalone binaries. Since applying source
maps relies on using file fetcher infrastructure
it's not feasible to use it for standalone binaries
that are not supposed to use that infrastructure.
2020-12-01 23:33:44 +01:00
Bartek Iwańczuk
abc883e6a7
upgrade: swc_bundler 0.17.3 (#8575) 2020-12-01 21:23:48 +01:00
Bartek Iwańczuk
838d39e2ac
refactor(cli): DRY cli/ast.rs (#8555)
This commit deduplicates logic for parsing
modules in cli/ast.rs
2020-12-01 21:20:18 +01:00
Liam Murphy
c74132d3cd
fix: higlight async and of in REPL (#8569) 2020-12-01 14:52:03 -05:00
Nayeem Rahman
108972c966
chore(cli/flags): Use deno compile --output for the out file (#8563) 2020-12-01 15:11:02 +01:00
Casper Beyer
5560a6d589
fix(repl): close calls sometimes prints results (#8558) 2020-12-01 14:13:30 +01:00
Bartek Iwańczuk
53fa45eb73
disable flaky watch tests (#8557) 2020-12-01 13:32:41 +01:00
Luca Casonato
6aa692fece
feat: deno compile (#8539) 2020-11-30 20:35:12 +01:00
Marcus Hultman
c7276e15e5
feat(unstable): add cbreak option to setRaw (#8383) 2020-11-30 11:08:03 -05:00
Bartek Iwańczuk
a22794e9cc
upgrade: deno_doc, deno_lint, dprint, swc (#8552) 2020-11-30 13:01:16 +01:00
Kevin (Kun) "Kassimo" Qian
b6bfc32f8d
fix(cli): support passing cli arguments under deno eval (#8547)
Fixes #8538
2020-11-30 13:10:21 +11:00
crowlKats
973af61d8b
feat(cli/tools/upgrade): canary support (#8476) 2020-11-29 20:00:35 +01:00
Luca Casonato
47a16d2118
fix: don't unconditionally build canary (#8536) 2020-11-29 17:08:38 +01:00
crowlKats
1ed37b7751
Make canary version semver compatible (#8537) 2020-11-29 08:16:50 -05:00
Yusuke Tanaka
d9b4182868
fix(watcher): watcher doesn't exit when module resolution fails (#8521)
This commit makes the file watcher continue to work even if module
resolution fails at the initial attempt, allowing us to execute `run`
or `bundle` subcommand when a script has invalid syntax. In such
cases, the watcher observes a single file that is specified as an
command line argument.
2020-11-28 15:18:13 +01:00
Casper Beyer
5588085c72
chore: update rustyline to 7.0.0 (#8516) 2020-11-28 15:03:40 +01:00
William Perron
57f163510a
fix(cli): make output of deno info --json deterministic (#8483)
Fixes #8458
2020-11-27 16:51:47 -05:00
William Perron
a16adca06b
test(cli): fix brittle network permission test (#8526) 2020-11-27 21:02:25 +01:00
Kitson Kelly
e2858d0bbb
chore: clippy future cleanups (#8514) 2020-11-28 06:47:35 +11:00
Bartek Iwańczuk
40bf26b37d
test: fix flaky "run_watch" test (#8519) 2020-11-27 20:22:09 +01:00
Liam Murphy
228ecb0acb
refactor(repl): use SWC lexer to highlight and validate (#8496) 2020-11-27 20:14:54 +01:00
William Perron
59f10b3604
fix(cli/ops/net): add write permissions for unixpackets datagrams & unix socket (#8511)
Fixes #7781
2020-11-27 13:43:39 -05:00
Ryan Dahl
f60c80e1bd
fix flaky tests by using exec in PTY tests (#8525) 2020-11-27 12:55:58 -05:00
Ryan Dahl
29374db11f
fix test_raw_tty hang (#8520) 2020-11-27 12:08:28 -05:00
Bartek Iwańczuk
22f951aa67
fix: panic in worker when closing at top level (#8510)
Fixes panic occurring in worker when "self.close()" is called
at the top level, ie. worker shuts down while
module evaluation promise hasn't yet resolved.
2020-11-27 14:19:24 +01:00
Benjamin Gruenbaum
4f46dc999b
fix: "onload" event order (#8376)
This commit fixes order of events for "onload" event. 

Previously handler attached using "window.onload" was
always fired before handlers added using "addEventListener".
2020-11-26 22:27:55 +01:00
Bartek Iwańczuk
e84704968e
fix(watch): fix flaky tests for watcher (#8508) 2020-11-26 20:12:26 +01:00
Ryan Dahl
8486b081ae
fix: re-enable test_raw_tty (#8509) 2020-11-26 12:59:03 -05:00
crowlKats
e6685f0f01
refactor(cli/tests): replace createResolvable with deferred (#8507) 2020-11-26 17:22:36 +01:00
Bartek Iwańczuk
85a5a081b2
refactor(cli): reorganize main.rs and split workers (#8495)
Factored out "init_v8_flags", "init_logger" and 
"get_subcommand" from "main" function.

Also "Worker" was removed in favor of moving 
logic to "MainWorker" and "WebWorker" respectively.
2020-11-26 15:17:45 +01:00
Bartek Iwańczuk
8d0b1b40f5
fix(websocket): set User-Agent header (#8502) 2020-11-26 15:12:08 +01:00
crowlKats
a837fb9a07
fix(cli/websocket): set User-Agent header (#8470) 2020-11-26 13:58:50 +01:00
Yusuke Tanaka
60e980c781
refactor(cli): Remove unnecessary conversion into BTreeMap (#8498)
This commit removes unnecessary conversion into BTreeMap. The value
that gets converted into BTreeMap is _originally_ BTreeMap, so this
conversion is just superfluous.

Additionally, a test is added so that we can make sure the keys in the
emitted lockfile are sorted alphabetically.
2020-11-26 13:16:48 +01:00
crowlKats
d40b0711a7
fix(websocket): Fix PermissionDenied error being caught in constructor (#8402) 2020-11-25 15:17:46 +01:00
Nayeem Rahman
adbbd85461
BREAKING(cli/tsc_config): Make isolatedModules non-configurable (#8482) 2020-11-25 13:06:54 +01:00
Chayim Refael Friedman
f42adf2277
docs: Add missing closing parenthesis (#8477) 2020-11-25 12:54:38 +01:00
crowlKats
a08d2eee2b
add canary versioning (#8480) 2020-11-25 05:30:14 -05:00
Valentin Anger
605874ee98
feat(test): horizontal separator between disjoint runs of lines (#8484)
Places a newline between non-consecutive line block in coverage
report to improve readability.
2020-11-24 22:26:38 +01:00
Luca Casonato
501a31fcf3
fix(op_crates/fetch): redirect: "manual" fetch should return type: "default" response (#8353) 2020-11-24 21:00:35 +01:00
Kitson Kelly
276f529755
feat(cli): update to TypeScript 4.1 (#7573) 2020-11-24 09:31:10 +11:00
William Perron
266925d772
fix(cli): add file URL support for Deno.readLink (#8423) 2020-11-23 22:11:56 +01:00
Bartek Iwańczuk
bc79d55649
v1.5.4 2020-11-23 15:10:58 +01:00
Bartek Iwańczuk
230a11e8a4
Revert "docs(cli): Fix documentation about usage of deno completions … (#8468)
This reverts commit 17d4cd9213.
2020-11-23 13:41:50 +01:00
Kitson Kelly
fec7fdc691
tests(cli): add test for improper unicode encoding (#8162)
and updates swc_ecma_codegen

Closes #8161
2020-11-23 10:22:13 +11:00
Nayeem Rahman
e7fc7d7151
fix(cli/tsc): allow non-standard extensions on imports (#8464) 2020-11-23 10:20:32 +11:00
Yusuke Tanaka
e3f73d3ec0
feat(unstable): Support --watch flag for bundle and fmt subcommands (#8276)
This commit adds support for "--watch" flag for "bundle" 
and "fmt" subcommands.

In addition to this, it refactors "run --watch" command so that
module resolution will occur every time the file watcher detects 
file addition/deletion, which allows the watcher to observe a file 
that is newly added to the dependency as well.
2020-11-22 21:45:44 +01:00
Mayank Agarwal
17d4cd9213
docs(cli): Fix documentation about usage of deno completions script (#8369)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-11-22 16:29:22 +01:00
crowlKats
750f179aeb
refactor(cli/tools/upgrade): rework upgrade (#8331)
This commit does major overhaul of "upgrade" subcommand, 
reducing complexity & giving more sensible console output. 

Removes gz support for archives. 

Uses last part of url instead of scraping to get latest version.
2020-11-22 16:07:05 +01:00
Nayeem Rahman
7405356e23
chore(cli/flags): Rename --failfast to --fail-fast (#8456) 2020-11-22 15:40:33 +01:00
Nayeem Rahman
14877f7fe2
feat(unstable): Add deno test --no-run (#8093)
This commit adds new flag to "deno test" subcommand
called "--no-run" that allows to preload, cache an type
check.
2020-11-22 14:06:51 +01:00
Max Drosdo.www
686a17fc07
fix(cli): support "deno run --v8-flags=--help" without script (#8110) 2020-11-21 23:33:42 +01:00
Anonymous
27dd786016
fix: "cloneValue" should return a Set when given a Set (#7972) 2020-11-21 17:29:18 +01:00
Bartek Iwańczuk
04f4201f30
refactor(corr): accept get_error_class_fn in RuntimeOptions (#8444)
This commit adds "get_error_class_fn" field to "RuntimeOptions"
struct in order to unify configuration of "JsRuntime".
2020-11-21 15:56:14 +01:00
Bartek Iwańczuk
cf7949db2f
upgrade: rusty_v8 0.13.0, v8 8.8.278.2 (#8446) 2020-11-21 14:45:07 +01:00
Bartek Iwańczuk
b63fe3f35c
upgrade: deno_doc, deno_lint, dprint, swc (#8443) 2020-11-21 13:17:42 +01:00
Bartek Iwańczuk
91f293442d
refactor(cli): worker event serialization (#8438)
This commit simplifies code responsible for serialization
of web worker events. Instead of using "PrettyJsError"
it's enough to downcast to "deno_core::JsError", making
the code less specific to cli/ implementation.
2020-11-20 13:25:18 +01:00
Bartek Iwańczuk
e582796f42
refactor(cli): rename fmt_errors::JsError to PrettyJsError (#8435)
This commit renames "fmt_errors::JsError" to "PrettyJsError"
to avoid confusion with "deno_core::JsError".

Consequently "CoreJsError" aliases to "deno_core::JsError"
were removed.

Additionally source mapping step has been removed from
"PrettyJsError::create" to better separate domains.
2020-11-19 20:37:22 +01:00
Bartek Iwańczuk
9eaa1fb71d
refactor(cli): move tooling to cli/tools/ (#8424)
This commit moves following tools into a single "tools"
module located at "cli/tools/mod.rs":
- formatter 
- linter
- test runner
- coverage collector
- installer
- binary upgrader
- repl
2020-11-19 19:19:34 +01:00
Mark Tiedemann
f4ac2b1475
fix(cli/tests): printf.exe doesn't exist on windows (#8404) 2020-11-19 07:06:19 -05:00
Bartek Iwańczuk
636af2850c
refactor(cli): rename fs module to fs_util (#8380)
This commit renames "fs" module in "cli/" to "fs_util". This is purely
cosmetic change; there were a few places which aliased "crate::fs"
to "deno_fs" which was very confusing with "fs" module in ops.
2020-11-16 20:48:50 +01:00
Mark Tiedemann
dd9c204884
Improve Deno.version type declaration (#8391) 2020-11-16 14:36:00 -05:00
Bartek Iwańczuk
ab7b8ba8d1
v1.5.3 2020-11-16 11:14:00 +01:00
Kitson Kelly
37fbbf8101
fix(cli): local sources are not cached in memory (#8328)
Fixes #4743
Closes #5253
Fixes #5631
Fixes #6116

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2020-11-16 13:19:31 +11:00
Bartek Iwańczuk
2cbf5c26ac
feat(lint): support --rules --json (#8384)
This commit adds support for "--json" flag in combination
with "--rules". List of rules is serialized to JSON and printed.
2020-11-14 20:51:30 +01:00
Yusuke Tanaka
9029003046
build: update dlint to v0.2.10 (#8284)
Update prebuilt "dlint" binary to v0.2.10 and fix diagnostics
for "require-await" rule.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-11-14 20:27:37 +01:00
Benjamin Gruenbaum
3d65e57d7c
fix: fix various global objects constructor length (#8373)
This commit changes various Web APIs constructors to 
match their signature in the browser.
2020-11-14 13:10:23 +01:00
Yusuke Tanaka
3a0ebff641
fix(fmt, lint): Make sure that target paths are not directory (#8375)
This commit merges implementations of "collect_files" and "files_in_subtree",
leaving only the former. Additionally it was ensured that directories are not yielded
from this function.
2020-11-14 13:05:26 +01:00
Divy Srivastava
d5661f677e
refactor: deno_crypto op crate (#7956)
This commit factors out "deno_crypto" op crate.

"rand" crate dependency was consequently moved to 
"deno_crypto" crate and reexported.
2020-11-13 22:01:57 +01:00
KNnut
2c8439bc1e
refactor(cli+core): various cleanups in Rust (#8336) 2020-11-13 09:17:31 +11:00
Max Drosdo.www
444c2cda4f
refactor(cli): minor cleanup of main.rs (#8362) 2020-11-13 08:49:59 +11:00
Akshat Agarwal
c744ee2756
fix(cli): don't walk the subdirectory twice when using the --ignore flag (#8040)
This commit reworks "collect_files" utility to accept "ignore" parameter
which allows to filter out files in a single iteration instead of walking
file tree second time to excude "ignored" files.
2020-11-11 20:53:55 +01:00
Benjamin Gruenbaum
a55e689e38
fix(op_crates/web): FileReader event handler order (#8348) 2020-11-11 16:59:49 +01:00
Benjamin Gruenbaum
b255a05f18
fix(web/worker) define event handlers in DOM order (#8334) 2020-11-10 07:15:42 -05:00
Andrew Mitchell
97a9620a01
test(cli/upgrade): remove test_compose_url_to_exec (#8329) 2020-11-10 10:41:33 +01:00
Benjamin Gruenbaum
94b68f9069
fix(cli/rt): dom handler order in websocket (#8320) 2020-11-10 14:34:42 +11:00
Kitson Kelly
0982056ff6
tests(cli): check ignores dynamic import errors (#8323)
Closes #6618
2020-11-10 10:18:43 +11:00
Kitson Kelly
c1fa8fbeba
fix(cli): allow root modules be .mjs/.cjs (#8310)
Fixes #6176
2020-11-10 10:10:41 +11:00
Kitson Kelly
b402b75c1d
fix(cli): allow setting of importsNotUsedAsValues in Deno.compile() (#8306)
Fixes #6663
2020-11-10 06:50:33 +11:00
Kitson Kelly
5375bf2e3f
fix(cli): allow declaration emits for Deno.compile() (#8303)
Fixes #8289
2020-11-10 06:49:15 +11:00
Scott Olson
57c2608e98
fix(cli): Use safe shell escaping in deno install (#7613) 2020-11-09 14:08:12 -05:00
KNnut
aaf7166a9d
refactor(cli): remove unnecessary format! calls (#8315) 2020-11-09 15:38:29 +01:00
Kitson Kelly
293cae5e1f
fix(cli): do not write tsbuildinfo when diagnostics are emitted (#8311)
Fixes #8309
2020-11-09 21:21:49 +11:00
Kitson Kelly
71d7482577
v1.5.2 (#8301) 2020-11-09 10:58:21 +11:00
Bartek Iwańczuk
a269dffe17
chore: remove dead code (#8298) 2020-11-08 23:35:36 +01:00
Bartek Iwańczuk
6743383d2e
upgrade: deno_doc, deno_lint, dprint, swc (#8292) 2020-11-08 23:27:36 +01:00
crowlKats
5995c58e63
refactor: auto detect target triples for upgrade (#8286) 2020-11-08 11:54:35 +01:00
Mo
ccc95bc9b9
refactor: rewrite permission_test to not depend on Python (#8291) 2020-11-08 11:50:27 +01:00
Kitson Kelly
e9edc05bed
fix(cli): ensure that transitory dependencies are emitted (#8275)
Fixes #8111
2020-11-08 07:00:42 +11:00
Kitson Kelly
88c4d3145b
fix(cli): allow remapping to locals for import map (#8262)
Fixes #7723
2020-11-07 15:04:22 +11:00
Kitson Kelly
4f67f0cc60
fix(cli): properly handle type checking root modules with type defini… (#8263) 2020-11-07 06:53:37 +11:00
Kitson Kelly
5f7c80986f
fix(cli): correct libs sent to tsc for unstable worker (#8260)
Fixes #8257
2020-11-06 12:10:19 +11:00
Kitson Kelly
96e03e0b93
refactor(cli): refactor file_fetcher (#8245) 2020-11-06 11:38:21 +11:00
Bartek Iwańczuk
791119d4af
build: rewrite tools/ scripts to deno (#8247)
This commit rewrites scripts in "tools/" directory
to use Deno instead of Python. In return it allows 
to remove huge number of Python packages in "third_party/".
2020-11-05 15:53:21 +01:00
ali ahmed
e7cfd90b0f
fix(cli/repl): Fixing syntax highlighting (#8202)
Fixes #8240
2020-11-05 14:08:01 +11:00
Ryan Dahl
ea8a598f7b
Remove dead code (#8235) 2020-11-03 13:22:33 -05:00
Bartek Iwańczuk
8e914be742
build: migrate to dlint (#8176)
This commit migrates repository from using "eslint" 
to "dlint" for linting JavaScript code.
2020-11-03 16:19:29 +01:00
Yoshiya Hinosawa
e736d0f60f
fix(prompt): fix display of non-ASCII characters on Windows (#8199) 2020-11-03 01:15:29 +01:00
Bartek Iwańczuk
c3dd19c5d3
refactor(cli): remove ProgramState::permissions (#8228)
This commit removes ProgramState::permissions field.

Having permissions parsed from CLI flags stored on globally
accessible state object made it easy to mistakenly use these
permissions in situations which required "runtime" permissions.
2020-11-02 23:37:55 +01:00
Kitson Kelly
d672e1405d
refactor(cli): cleanup compiler snapshot and tsc/module_graph (#8220) 2020-11-03 06:41:20 +11:00
Trivikram Kamat
40cd4db974
feat(cli): bump TypeScript to 4.0.5 (#8138) 2020-11-03 06:39:39 +11:00
Yoshiya Hinosawa
397fec63d1
fix(op_crates/web): fix URLSearchParams, malformed url handling (#8092)
Co-authored-by: Evan <c4t@tuta.io>
2020-11-02 18:58:29 +01:00
Benjamin Gruenbaum
a8ca9fe7bb
test(op_crates/web): add EventTarget tests (#8205) 2020-11-02 18:42:22 +01:00
Yoshiya Hinosawa
0e5c8c03ac
add commit hash and target to long_version output (#8133) 2020-11-02 12:40:33 -05:00
Kitson Kelly
272e9b82eb
fix(cli): inject helpers when transpiling via swc (#8221)
Fixes #8212
2020-11-02 22:33:43 +11:00
Kitson Kelly
fdcc78500c
refactor(cli): migrate runtime compile/bundle to new infrastructure (#8192)
Fixes #8060
2020-11-02 13:51:56 +11:00
Benjamin Gruenbaum
9397cf508e
fix(op_crates/web): make TextEncoder work with forced non-strings (#8206)
Fixes: #8201
2020-11-02 10:57:18 +11:00
Nayeem Rahman
d9b8778c45
refactor(cli/permissions): Cleanup Flags to Permissions conversion (#8213) 2020-10-31 23:44:42 +01:00
Luca Casonato
03769f11b5
v1.5.1 2020-10-31 15:32:43 +01:00
Bartek Iwańczuk
2a36e2f892
upgrade: deno_doc, deno_lint, dprint, swc (#8197)
- deno_doc 0.1.14
- deno_lint 0.2.7
- dprint-plugin-typescript 0.32.7
- swc_bundler 0.14.1
- swc_ecmascript 0.13.1
2020-10-30 20:39:53 +01:00
Bartek Iwańczuk
ce75101e3e
fix: Deno.fdata(), Deno.fdatasync() (#8193)
These APIs were stabilized in 1.5.0, but were
never added to the "stable" Deno namespace. This
commit fixes that.
2020-10-30 13:06:09 +01:00
Bartek Iwańczuk
4f57ca0daf
fix: panic in bundler (#8168)
This commit fixes panic in bundler which was caused
by not setting thread-local slots.
2020-10-30 12:19:49 +01:00
Nayeem Rahman
6be6c517d0
fix(cli/fmt): Strip "\\?\" prefix when displaying Windows paths (#8135) 2020-10-30 03:19:03 +01:00
Sander Hahn
1854c6f73b
fix(cli): prompt works with windows eol and eof (#8149) 2020-10-29 18:35:58 +01:00
Luca Casonato
8d99adb6c4
refactor: don't spin up V8 for deno cache (#8186) 2020-10-29 14:19:55 +01:00
Kitson Kelly
b0482400c9
fix(cli): make hashes of tsconfig deterministic (#8167)
Fixes #8163
2020-10-29 21:18:18 +11:00
Yusuke Tanaka
bfce376c68
refactor(watch): create single watcher for whole process (#8083)
This commit rewrites file watcher used with --watch flag.

Instead of creating new watcher after each restart, only a single
watcher is created for whole process. Additionally debouncing
mechanism has been added to prevent infinite restart loops 
if multiple files were changed in quick succession.

Co-authored-by: bartossh <lenart.consulting@gmail.com>
2020-10-28 12:41:18 +01:00
Kevin (Kun) "Kassimo" Qian
07359b7957
fix(repl): don't hang on unpaired braces (#8151)
Previously, entering a single ']' would cause repl to forever accepting
new lines, due to that `ValidationResult::Invalid` would actually be
consumed by the editor itself while continue building the lines. Instead
we should mark it as `Valid` and send the bad input for evaluation to
get the proper error from V8.

Before:
```
> ]
(you can keep entering new line here, and it will never consume input
until you Ctrl-C)
```

After:
```
> ]
Uncaught SyntaxError: Unexpected token ']'
>
```
2020-10-28 06:03:17 -04:00
Kitson Kelly
e01664d0ae
fix(cli): module graph handles redirects properly (#8159)
Fixes #8154
2020-10-28 20:38:09 +11:00
Kitson Kelly
6844caa9a5
fix(cli): restore tripleslash lib refs support (#8157)
Fixes #8147
2020-10-28 11:52:20 +11:00
Bartek Iwańczuk
dd01f206da
v1.5.0
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-10-27 16:00:23 +01:00
Ross Weir
60cd7695ef
fix(cli): handle URL paths in Deno.mkdir() (#8140) 2020-10-27 13:21:32 +01:00
Kitson Kelly
5af1dcfe29
fix(cli): do not throw on empty typescript files (#8143)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-10-27 13:19:27 +01:00
Ross Weir
9fb4931a95
fix(op_crates/web): Expose event properties in console output (#8103)
Fixes #8073
2020-10-27 09:22:03 +11:00
Kitson Kelly
b03f4a4a1c
fix(cli): restore permission check on workers (#8123)
Fixes #8120
2020-10-27 06:56:00 +11:00
Luca Casonato
acc201625f
chore: add bundle_no_check benchmark (#8130) 2020-10-26 19:57:29 +01:00
Ryan Dahl
c4d33e8d77
fix: Use -rw-r--r-- for cache files (#8132) 2020-10-26 12:58:58 -04:00
Tim Reichen
ae86cbb551
rename(std/testing): rename assert*Contains to assert*Includes (#7951)
This commit renames two assertion functions to better align with JS API:
- assertStringContains -> assertStringIncludes
- assertArrayContains -> assertArrayIncludes
2020-10-26 16:03:30 +01:00
Elias Sjögreen
305a9c04ba
feat(unstable): add Deno.systemCpuInfo() (#7774) 2020-10-26 10:54:27 -04:00
Kid
4c41ba5ad7
fix(op_crates/fetch): ensure Request.method to be string (#8100)
Ensure "Request.method" to be the default value ("GET") if 
"init.method" is not defined, which follows browser's behavior.
2020-10-26 15:02:08 +01:00
Bartek Iwańczuk
57cad53945
refactor(cli): rewrite Deno.transpileOnly() to use SWC (#8090)
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2020-10-26 14:03:03 +01:00
Bartek Iwańczuk
aebbdd5cc2
Revert "feat(lint): stabilize "deno lint" subcommand (#8075)" (#8128)
This reverts commit c5c48f845a.
2020-10-26 13:36:13 +01:00
Nayeem Rahman
822e5b6536
fix(core/runtime): Indicate exceptions in promises (#8124)
Fixes #4879
2020-10-26 14:34:00 +11:00
Ross Weir
ece1e1d5f1
feat(cli): pass script args for test command (#8121)
Closes #8096
2020-10-26 11:25:43 +11:00
Kitson Kelly
3d19fb493b
fix(cli): properly handle roots with extensions that don't match media type (#8114) 2020-10-26 07:17:58 +11:00
Bartek Iwańczuk
95854b88ad
refactor(run): use new module graph for run --watch (#8085)
This commit changes how "deno run --watch" is implemented
by migrating to use ModuleGraph2.
2020-10-25 01:27:00 +02:00
Kitson Kelly
dd952818bc
test(cli): ensure modules can export typed JS files (#8101)
Closes #5935
2020-10-25 07:05:33 +11:00
Kitson Kelly
117fcf61f0
test(cli): dynamic imports not evaluated until runtime (#8102)
Closes #7997
2020-10-25 07:02:11 +11:00
Bartek Iwańczuk
35f184cdcc
refactor: use of lock file in ModuleGraph2 (#8087) 2020-10-23 23:01:54 +02:00
Bartek Iwańczuk
9d36331278
Revert "feat(cli): Add deno cache --test and --worker (#7920)" (#8089)
This reverts commit be15cf285d.
2020-10-23 16:56:25 +02:00
Nayeem Rahman
be15cf285d
feat(cli): Add deno cache --test and --worker (#7920) 2020-10-23 13:31:49 +02:00
Toan Nguyen
29e05bb014
fix: typos in cli and core (#8082) 2020-10-23 13:19:37 +02:00
Kitson Kelly
ab898556a4
refactor(cli): move bundle check to new infrastructure (#8071) 2020-10-23 22:05:41 +11:00
Nayeem Rahman
a3024a6dc5
BREAKING(cli/tsc): Enable isolatedModules by default (#8050) 2020-10-23 12:38:35 +02:00
Nikolai Vavilov
f56c7868ab
docs(cli): update link to dprint-plugin-typescript (#8052) 2020-10-23 12:21:02 +11:00
Kitson Kelly
7e2c7fb6c5
refactor(cli): migrate run and cache to new infrastructure (#7996)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-10-23 11:50:15 +11:00
Bartek Iwańczuk
c5c48f845a
feat(lint): stabilize "deno lint" subcommand (#8075)
This commit stabilizes "deno lint" by removing
the need to pass --unstable flag.

--unstable is still required when using --json flag.
2020-10-22 21:52:37 +02:00
Bartek Iwańczuk
9b20cfbee8
upgrade: deno_doc, deno_lint, dprint, swc (#8077)
- deno_doc 0.1.13
- deno_lint 0.2.5
- dprint-plugin-typescript 0.32.6
- swc_bundler 0.12.0
- swc_ecmascript 0.11.1
2020-10-22 20:36:06 +02:00
Divy Srivastava
d592c128cf
chores(cli/fmt): make --ignore stable (#7922)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-10-22 19:04:35 +02:00
nerix
0a2f0fe7f2
fix(cli/rt/websockets): Only add Sec-WebSocket-Protocol if it's not empty (#7936) 2020-10-22 17:09:44 +02:00
Akshat Agarwal
d6c824a6c3
refactor(cli): use PathBuf instead of String for lint and fmt subcommands (#8042) 2020-10-21 13:12:01 +02:00
Kitson Kelly
0fb39f9176
feat(cli): add types for WeakRef/FinalizationRegistry (#8056)
Fixes #8051
2020-10-21 21:57:01 +11:00
Ryan Dahl
9e2e2dfb20
bump versions for op crates (#8048) 2020-10-20 10:31:20 -04:00
Casper Beyer
dfe19c5c75
feat: stabilize Deno.fsync and Deno.fdatasync (#8038) 2020-10-20 09:52:10 -04:00
Nayeem Rahman
070d99645f
chore: Rename --importmap to --import-map (#7032)
--importmap still works as an alias to --import-map
but is not visible in CLI help output.
2020-10-20 14:30:59 +02:00
aca
9cf06f76fd
fix(op_crates/web): TextEncoder should return error message with original input (#8005) 2020-10-20 13:47:38 +02:00
Casper Beyer
d9ae74019e
fix(cli): use rid getter for stdio (#8014)
This changes the rid of Deno.stdin, Deno.stdout, Deno.stderr from a
mutable property into a getter to match the rid semantics of Deno.File.
2020-10-20 13:20:17 +02:00
Nayeem Rahman
7aba07cc77
fix(cli/worker): Print error stacks from the origin Worker (#7987)
Fixes #4728
2020-10-20 15:05:42 +11:00
Kitson Kelly
57e95032c8
feat(cli): add support for bundle --no-check (#8023)
Fixes #6686
2020-10-20 14:10:42 +11:00
Jesse Jackson
992c2a436e
fix(cli/rt/performance): check for object props in startOrMeasureOptions before throwing (#7884)
Fixes #7876

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-10-20 13:43:29 +11:00
Leonard Ginters
623ac9e6df
fix(op_crates/web): TextEncoder should throw RangeError (#8039)
This commit changes error type thrown by TextEncoder, when
provided encoding is not supported matching Chromium behavior.
2020-10-19 23:56:29 +02:00
Absebo
1474d5d76d
fix(cli): Handling of relative importmaps while using watch (#7950) 2020-10-19 23:53:39 +02:00
Casper Beyer
c488468b32
feat(cli/repl): add tab completion (#7827)
This commit adds tab completion in REPL. 

Currently it works only for global identifiers and object properties.
2020-10-19 21:25:21 +02:00
Nayeem Rahman
3f5513758d
feat(cli/installer): Add missing flags for deno install (#7601)
This commit adds support for following flags:
- deno install --importmap
- deno install --no-remote
- deno install --lock
- deno install --lock-write
- deno install --cached-only
- deno install --v8-flags
- deno install --seed
2020-10-19 21:19:20 +02:00
Casper Beyer
9d664f8375
fix(cli/repl): ignore pair matching inside literals (#8037) 2020-10-19 19:13:23 +02:00
Luca Casonato
08441b855d
fix(op_crates/fetch): Body.body should be stream of Uint8Array (#8030) 2020-10-19 17:01:36 +02:00
Casper Beyer
35028db5e5
fix(cli/repl): unterminated string literal should invalidate (#7896)
This adds the grave character to the pair matching so that template
string literals trigger multi-line edits.
2020-10-19 16:54:50 +02:00
vwkd
e432db70e9
docs: readTextFile / readTextFileSync throw when reading directory (#7999) 2020-10-19 15:06:04 +02:00
Casper Beyer
8eb44537ec
fix(cli/repl): keyboard interrupt should continue (#7960)
This changes the behavior of keyboard interrupts (ctrl+c) to continue,
clearing the current line instead of exiting.

Exit can still be done with ctrl+d or by calling close().
2020-10-19 14:06:21 +02:00
Casper Beyer
f5c23f8058
fix(cli/repl): write all results to stdout (#7893)
This writes all evaluaton results to stdout regardless if the result is
an error or not.

This matches the behavior of other read-eval-print-loops like Node.
2020-10-19 13:41:25 +02:00
Ryan Dahl
fb2cae9687
deno_core 0.64.0 (#8025) 2020-10-19 06:35:09 -04:00
Bartek Iwańczuk
8f9da368f7
refactor(lint): show hint for lint errors (#8016)
This commit adds formatting of optional "hint" that
can be present in lint diagnostic.
2020-10-18 16:26:05 +02:00
Casper Beyer
b33e8d5d42
refactor(cli/repl): extract is_closing to a function (#8015)
This extracts is closing into a function so that it can easily be used
as the condition for the loop.
2020-10-18 16:19:47 +02:00
Bartek Iwańczuk
c1c7601304
upgrade: deno_doc, deno_lint, dprint, swc (#8009) 2020-10-17 17:08:23 +02:00
William Perron
943b0980c7
feat(cli/ops): add the sleep_sync op (#7974) 2020-10-15 21:06:31 -04:00
Kitson Kelly
bbe4474d39
fix(cli): ModuleGraph2 properly handles redirects (#7981) 2020-10-16 10:34:55 +11:00
Bartek Iwańczuk
bd0c64b9ae
Reland feat(cli/console): inspect with colors regardless of Deno.noColor (#7976) 2020-10-15 12:32:03 +02:00
Bartek Iwańczuk
81635c59e6
Revert "feat(cli/console): inspect with colors regardless of Deno.noColor (#7778)" (#7973)
This reverts commit f75bd89aff.
2020-10-14 18:54:29 +02:00
TTtie
f75bd89aff
feat(cli/console): inspect with colors regardless of Deno.noColor (#7778)
This commit adds the ability for users to inspect items stylized
with ANSI colors regardless of the value of Deno.noColor.
2020-10-14 17:51:56 +02:00
vwkd
f9489e9acb
fix typos (#7964) 2020-10-14 10:28:21 -04:00
Bartek Iwańczuk
12e700bddf
fix(test): return error when awaiting unresolved promise (#7968)
This commit fixes test runner by awaitning "Deno.runTests()" call,
which ensures proper error is returned when there's an unresolved
promise that's being awaited.
2020-10-14 15:19:13 +02:00
Yoshiya Hinosawa
e9f02c2314
fix(console): fix the test cases of function inspections (#7965) 2020-10-14 15:01:03 +02:00
Casper Beyer
e2a1a7c937
refactor(cli/repl): clean up prelude injection (#7967)
This extracts prelude injection into a helper function and moves the
prelude string literal into a top level static string to help trim some
of the fat out of the run function.
2020-10-14 14:34:05 +02:00
Bartek Iwańczuk
135053486c
fix: top-level-await module execution (#7946)
This commit changes implementation of top-level-await in "deno_core".

Previously promise returned from module evaluation was not awaited,
leading to out-of-order execution of modules that have TLA. It's been
fixed by changing "JsRuntime::mod_evaluate" to be an async function
that resolves when the promise returned from module evaluation also
resolves. When waiting for promise resolution event loop is polled
repeatedly, until there are no more dynamic imports or pending
ops.
2020-10-14 14:04:09 +02:00
Kitson Kelly
10654fa955
refactor(cli): add tsc2 (#7942)
Ref #7225
2020-10-14 10:52:49 +11:00
Ryan Dahl
374d433f1f
Remove dead code (#7963) 2020-10-13 18:24:40 -04:00
Nayeem Rahman
d0c2714c03
fix(op_crates/web/url): apply backslash replacement to the pathname setter (#7937) 2020-10-13 17:16:10 +02:00
Casper Beyer
bbf7b2ee72
feat(cli/repl): add regex based syntax highlighter (#7811)
This commit adds a simple regex replace based highlighter 
to the REPL editor.

It tries to match the color palette of Deno.inspect()
2020-10-13 16:23:02 +02:00
Yoshiya Hinosawa
0dcaea72ae
feat: add alert, confirm, and prompt (#7507)
This commit adds "alert", "confirm" and "prompt" functions from web standards.
2020-10-13 15:31:59 +02:00
Bartek Iwańczuk
0bd3cea0ff
refactor(cli): rename GlobalState to ProgramState (#7914) 2020-10-13 13:35:35 +02:00
Kitson Kelly
000ac5c40b
reafactor(cli): use Emit enum and rename ts_build_info (#7952) 2020-10-13 21:54:28 +11:00
Kitson Kelly
26639b3bac
chore(cli): remove dead code (#7941) 2020-10-12 22:25:25 +11:00
Kitson Kelly
e877b36072
refactor(cli): move info subcommand over to new module graph (#7892) 2020-10-12 13:25:27 +11:00
Valentin Anger
fede13f2eb
feat(cli): support importmap flag with deno doc subcommand (#7821)
Fixes #7783
2020-10-12 10:05:46 +11:00
Nayeem Rahman
5f3028af13
fix(cli/rt/main): Add global interface objects (#7875) 2020-10-12 09:04:43 +11:00
Yoshiya Hinosawa
265a9fb932
fix(console): fix inspection of Function (#7930)
This commit fixes the inspection of functions. The current 
implementation gets the name of the type of the function 
from "f.__proto__.constructor.name", and it throws when 
the prototype is set to null. 

This commit checks the prototype before accessing its 
constructor name and uses the generic name 'Function' 
if the prototype is not available.
2020-10-11 22:04:26 +02:00
Casper Beyer
86dc55134e
fix(cli/console): only inspect getters with option (#7830) 2020-10-11 21:52:20 +02:00
Casper Beyer
fa80649926
refactor(cli/repl): get context id from notification (#7864)
This takes the execution context id from a notification which is sent on
Runtime.enable rather than hard-coding it to a magic value.
2020-10-11 19:49:55 +02:00
Bartek Iwańczuk
527628e186
reland JsRuntime/Worker is not a Future (#7924) 2020-10-11 13:20:40 +02:00
Bartek Iwańczuk
9e9ec9784a
v1.4.6 2020-10-10 12:30:55 +02:00
Ryan Dahl
08bb8b3d53
Fix 100% CPU idling problem by reverting #7672 (#7911)
* Revert "refactor: Worker is not a Future (#7895)"

This reverts commit f4357f0ff9.

* Revert "refactor(core): JsRuntime is not a Future (#7855)"

This reverts commit d8879feb8c.

* Revert "fix(core): module execution with top level await (#7672)"

This reverts commit c7c7677825.
2020-10-10 11:41:11 +02:00
Lively
782e6a2ed5
fix(op_crate/web): add padding on URLSearchParam (#7905)
Fixes #7888
2020-10-10 16:20:24 +11:00
Bartek Iwańczuk
f4357f0ff9
refactor: Worker is not a Future (#7895)
This commit rewrites deno::Worker to not implement Future
trait.

Instead there are two separate methods:
- Worker::poll_event_loop() - does single tick of event loop
- Worker::run_event_loop() - runs event loop to completion

Additionally some cleanup to Worker's field visibility was done.
2020-10-09 19:08:10 +02:00
Nayeem Rahman
98727b331d
fix(op_crates/fetch): Stringify and parse Request URLs (#7838)
Fixes #7837
2020-10-09 16:12:44 +11:00
crowlKats
c06fbc449d
Fix typos (#7882) 2020-10-08 15:40:49 -04:00
Bartek Iwańczuk
b5e4b63a88
v1.4.5 2020-10-08 14:20:18 +02:00
Kitson Kelly
9d71b0ef5b
fix: update worker types to better align to lib.dom.d.ts (#7843) 2020-10-08 11:43:26 +02:00
Nayeem Rahman
986ad08bce
fix(cli/rt/error_stack): Improve message line formatting (#7860) 2020-10-08 11:05:19 +02:00
Simon Rask
62f8d945e1
fix(cli/fs) Small change in filter expression (#7865) 2020-10-08 10:57:45 +02:00
Bartek Iwańczuk
d8879feb8c
refactor(core): JsRuntime is not a Future (#7855)
This commit rewrites deno_core::JsRuntime to not implement Future
trait.

Instead there are two separate methods:
- JsRuntime::poll_event_loop() - does single tick of event loop
- JsRuntime::run_event_loop() - runs event loop to completion
2020-10-07 22:30:06 +02:00
Nayeem Rahman
8bd7c936f9
fix(cli/rt/console): Don't require a prototype to detect a class instance (#7869) 2020-10-07 16:08:54 -04:00
Bartek Iwańczuk
46e9758962
upgrade: deno_doc, deno_lint, dprint, swc (#7862) 2020-10-07 20:29:12 +02:00
Bartek Iwańczuk
9b70f2f345
refactor: rename isolate to js_runtime (#7858)
This commit renames occurrences of "isolate" variable name
to "js_runtime". This was outstanding debt after renaming
deno_core::CoreIsolate to JsRuntime.
2020-10-07 17:20:20 +02:00
Bartek Iwańczuk
83f6def3c6
refactor(core): JsRuntime doesn't defer to OwnedIsolate (#7853)
Remove Deref and DeferMut implementations for JsRuntime.
2020-10-07 15:56:52 +02:00
Nayeem Rahman
c226d3af25
fix(cli/ops/fs): Don't force Windows paths separate paths with forward slash (#7833) 2020-10-07 14:05:43 +02:00
Kitson Kelly
99aa23b8dd
refactor(cli): remove TextDocument (#7850) 2020-10-07 22:43:44 +11:00
Casper Beyer
cb3a3a1e95
refactor(cli/inspector): use &str for post_message (#7851)
This changes the signature of InspectorSession.post_message to take a
&str rather than a String avoiding the need call str.to_string at each
call site.
2020-10-07 10:24:15 +02:00
Kitson Kelly
7ab645f512
refactor(cli): cleanups to new module graph (#7846) 2020-10-07 16:24:15 +11:00
Casper Beyer
21965e8a96
refactor(cli/repl): tightly integrate event loop (#7834) 2020-10-06 13:50:48 +02:00
Bartek Iwańczuk
c7c7677825
fix(core): module execution with top level await (#7672)
This commit fixes implementation of top level await in "deno_core".

Previously promise returned from module execution was ignored causing to execute
modules out-of-order.

With this commit promise returned from module execution is stored on "JsRuntime"
and event loop is polled until the promise resolves.
2020-10-06 10:18:22 +02:00
Kitson Kelly
d0f734bacc
chore: add a bundle benchmark (#7828) 2020-10-05 21:39:46 +11:00
Nayeem Rahman
72425810b8
perf(cli/console): Don't add redundant ANSI codes (#7823) 2020-10-05 11:50:49 +02:00
Kitson Kelly
f632b3b6e7
fix(core): handle unregistered errors in core better (#7817) 2020-10-05 20:35:51 +11:00
JavascriptMick
f377b611ba
chore: add lockfile tests (#7816)
Fixes #7653
2020-10-05 10:32:18 +11:00
tokiedokie
ec96323823
chore(std/http): rename http_bench.ts -> bench.ts (#7509) 2020-10-04 13:34:52 +02:00
Trivikram Kamat
d0eb179132
docs: end sentences with a period in markdown (#7813) 2020-10-04 07:19:11 +11:00
Nayeem Rahman
315724b856
feat(unstable): revert "enable importsNotUsedAsValues by default #7413" (#7800)
This reverts commit fbb18d40d3.
2020-10-03 16:40:26 +02:00
Bartek Iwańczuk
ae1ed2d166
v1.4.4 2020-10-03 14:58:10 +02:00
Casper Beyer
c191ca1aeb
fix(cli/repl): put the thread to sleep when idle (#7804) 2020-10-03 12:51:25 +02:00
CGQAQ
59312f3936
fix(cli): update type definitions to align to TS dom (#7791)
Fixes #7746
2020-10-03 12:57:31 +10:00
Casper Beyer
4c7f53b04b
fix(cli/repl): enable colors on inspected values (#7798) 2020-10-02 15:51:08 +02:00
Bartek Iwańczuk
63efa5f15d
v1.4.3 2020-10-02 14:37:48 +02:00
Bartek Iwańczuk
e5348a6a38
upgrade: swc, deno_doc, deno_lint, dprint (#7793) 2020-10-02 13:51:37 +02:00
Casper Beyer
5cd29b37f7
feat(cli/repl): enable await and let re-declarations (#7784)
This enables `replMode` during evaluations which allows for top level
await and let re-declarations.
2020-10-02 13:17:47 +02:00
Casper Beyer
6825d7f13d
fix(cli/repl): use a default referrer when empty (#7794)
This makes use of a default referrer when its empty in repl mode so that
dynamic imports work in the global evaluation context.

Co-authored-by: Bartek Iwanczuk <biwanczuk@gmail.com>
2020-10-02 13:13:23 +02:00
Casper Beyer
4c779b5e8c
refactor(repl): use an inspector session (#7763)
This ports the REPL over to Rust and makes use of an inspector session to run a REPL on top of any isolate which lets make full use of rustylines various things like validators and completors without having to introduce a bunch of hard to test internal ops and glue code.

An accidental but good side effect of this is that the multiple line input we previously had is now an editable multi-line input prompt that is correctly stored in the history as a single entry.
2020-10-02 01:14:55 +02:00
Kitson Kelly
e077b93d77
refactor: add concept of 'legacy' compiler to enable non-breaking refactoring (#7762) 2020-10-01 20:33:15 +10:00
Kitson Kelly
ef5ae4547a
chore: ensure cache is 'valid' during benchmarks (#7770) 2020-10-01 20:32:05 +10:00
Nayeem Rahman
b689e60b60
fix(cli/console): Catch and format getter errors (#7766) 2020-10-01 11:25:34 +02:00
Bartek Iwańczuk
290da280a8
refactor: improve op crate interfaces for other consumers (#7745) 2020-09-30 10:51:01 -04:00
Kitson Kelly
dcd0595058
fix: check cached versions during transpile (#7760)
Fixes: #7759
2020-09-30 21:46:42 +10:00
Kitson Kelly
23a7ea9c85
fix: bundle loader returns exported value (#7764)
Fixes: #7761
2020-09-30 18:51:19 +10:00
Kitson Kelly
7c62b7b043
fix(cli): use global_state file_fetcher when using SpecifierHandler (#7748)
Fixes: #7709
2020-09-30 17:22:58 +10:00
Nayeem Rahman
27ee4b2551
feat(cli/console): Add Deno.InspectOptions::colors (#7742)
Ref: https://github.com/denoland/deno/pull/7516#pullrequestreview-489567120
2020-09-30 12:59:50 +10:00
Casper Beyer
2184cf5c07
refactor(cli): extract inspector session (#7756)
This extracts the inspector session specific bits from CoverageCollector
into a standalone struct dubbed `InspectorSesssion` which can be used as
a general purpose session to communicate with the inspector on the same
thread as an isolate/inspector pair lives on.
2020-09-29 23:05:06 +02:00
crowlKats
7713274efd
fix(websocket): add missing close events and remove extra error event (#7606) 2020-09-29 11:42:29 +02:00
Kitson Kelly
b014a98534
refactor: improve graph and tsc_config (#7747) 2020-09-29 17:16:12 +10:00
Casper Beyer
970d412a08
chore(cli/coverage): remove unused runtime domain (#7749)
Previously when we used the websocket to talk to the inspector we used
the runtime domain to send a "runIfWaitingForDebugger" message.

However this is not required since we now talk to the inspector directly
and no longer send said message so this removes the enabling of the
domain entirely.
2020-09-29 00:25:54 -04:00
Casper Beyer
6587d1bce8
fix(cli/test): do not start inspector server when collecting coverage (#7718) 2020-09-28 12:22:29 +02:00
Bartek Iwańczuk
45d4fd44c9
refactor: move op state registration to workers (#7696) 2020-09-28 12:14:11 +02:00
Valentin Anger
e3adeea769
feat(unstable): add module specifier to deno info --json output (#7725) 2020-09-27 21:50:18 +02:00
Nayeem Rahman
8cbf0e75b2
fix: Use $deno$test.ts instead of .deno.test.ts (#7717) 2020-09-27 14:21:11 -04:00
Casper Beyer
5db72dcaf3
fix(cli/inspector): shutdown server gracefully on drop (#7716) 2020-09-27 14:19:36 -04:00
Luca Casonato
ebcb032c6b
fix: no check recognizes require (#7720) 2020-09-27 14:16:18 -04:00
Giorgi Rostomashvili
eaba9adb03
fix: net listen crashes on explicit undefined hostname (#7706) 2020-09-27 10:44:53 -04:00
David Sherret
df02e31507
feat(fmt): Sort named import and export specifiers (#7711) 2020-09-27 12:22:32 +02:00
Luca Casonato
c03fe284cf
docs: add jsdoc for WebAssembly namespace (#7703) 2020-09-26 20:33:20 +02:00
Bartek Iwańczuk
e1beebc71a
refactor: factor out check_unstable op helper (#7695) 2020-09-26 20:26:51 +02:00
Bartek Iwańczuk
f64a44810e
refactor: combine MainWorker::new and MainWorker::create (#7693)
* combine MainWorker::new and MainWorker::create

* remove compiler_starts fields

* make op_state types explicit for readability
2020-09-26 18:16:33 +02:00
Bartek Iwańczuk
ff785bc35a
refactor: use JsRuntime to implement TSC (#7691)
This commits removes "CompilerWorker" in favor of
using "JsRuntime".

"cli/ops/compiler.rs" has been removed in favor of inline
registration of ops in "cli/tsc.rs"
2020-09-26 16:33:25 +02:00
Bartek Iwańczuk
18b7109f76
refactor: prune unneeded JS code (#7689) 2020-09-26 15:59:24 +02:00
Nayeem Rahman
0ffaaba164
fix(cli/dts): Use var instead of const and let for globals (#7680) 2020-09-26 07:23:35 +10:00
Bartek Iwańczuk
b6c189e88e
refactor: clean timers tests (#7679) 2020-09-25 18:34:20 +02:00
Bartek Iwańczuk
dacb340f8f
v1.4.2 2020-09-25 16:53:48 +02:00
Luca Casonato
3204092732
refactor: class instead of var+interface in d.ts (#7514) 2020-09-25 16:21:34 +02:00
Bartek Iwańczuk
83f53c6455
refactor: remove tsc/40_error_stack.js (#7673)
This commit removes cli/tsc/40_error_stack.js as it is not
needed in TSC host. All errors originating in TSC are terminal
and don't require source mapping hence we can rely on default
stack traces provided by deno_core.

Additionally tsc/06_util.js was removed and its code moved
to tsc/99_main_compiler.js
2020-09-25 14:04:51 +02:00
Kitson Kelly
fd1c913985
fix(cli): customInspect works on functions (#7670)
Fixes #7650
2020-09-25 21:36:26 +10:00
Casper Beyer
01147fab80
refactor(cli/inspector): make server optional (#7656)
This makes inspector registration with the server with optional and
explicit to allow for inspectors to exist without spinning up the
server.

As a side effect of the server being explicitly passed around it also
makes it possible to bind multiple servers.
2020-09-25 10:24:51 +02:00
Kitson Kelly
c489589e2b
refactor: new module graph used for no check (#7621) 2020-09-25 08:31:17 +10:00
Will
7726cfb932
Replaced legacy chrome-devtools:// scheme. (#7659)
The legacy chrome-devtools scheme was removed from the Chromium codebase.  The new scheme is simply "devtools://"
6700d12448
2020-09-24 18:06:46 -04:00
Ryan Dahl
82db91372f
refactor: Simplify op_fetch_asset signature (#7655) 2020-09-24 15:29:18 +02:00
Nayeem Rahman
6a2ce3d91f
fix(lib.deno.shared_globals): Change the Console class to an interface (#7646)
Fixes #7494
2020-09-24 20:40:33 +10:00
Casper Beyer
6254bd41b7
fix(cli/coverage): print lines with no coverage to stdout (#7640) 2020-09-23 14:12:24 -04:00
Casper Beyer
e1b61d6794
fix(cli/console): quote non-alphanumeric symbols (#7641)
This quotes and escapes symbol descriptions that contains characters
outside of the basic alpha-numeric identifier range.
2020-09-23 14:10:35 -04:00
Casper Beyer
d68fb81342
fix(cli/console): enclose symbol keys in brackets (#7642)
This encloses symbol keys when used in objects with brackets (e.g
[Symbol("Symbol.iterator")]).
2020-09-23 13:58:28 +02:00
bartOssh
29dd62b08c
fix(watch): watch importmap file for changes (#7580) 2020-09-23 13:56:16 +02:00
Trivikram Kamat
8a6a390457
docs: ts upgrade instructions to exclude some .d.ts files (#7638) 2020-09-23 15:19:30 +10:00
Trivikram Kamat
49807ac4ac
feat: bump TypeScript to 4.0.3 (#7637) 2020-09-23 14:36:03 +10:00
Kitson Kelly
751bb45a0a
fix: ignore fileExists in tsc host (#7635)
Fixes #7630
2020-09-23 11:39:20 +10:00
Bartek Iwańczuk
68fd7a927b
refactor(core): support error stack, remove js_check (#7629)
This commit adds support for stack traces in "deno_core".

Implementation of "Display" trait for "JsError" has been updated
and in consequence "deno_core::js_check" became obsolete and
removed.
2020-09-22 23:30:03 +02:00
Bartek Iwańczuk
dd1cd4d952
fix: clearing timers race condition (#7617) 2020-09-22 19:33:29 +02:00
Nayeem Rahman
a43984c9cf
refactor(cli/fmt_errors): Color stack traces in Rust (#7628) 2020-09-22 19:01:30 +02:00
Casper Beyer
a33315aaa7
fix(cli/console): quote object symbol keys that are invalid identifiers (#7553) 2020-09-22 11:10:02 -04:00
Yusuke Tanaka
c30c782c2c
fix(logger): change log level to which prefix added (#7582) 2020-09-22 11:08:10 -04:00
Casper Beyer
cca8856fbf
refactor(cli/coverage): remove dependency on global state (#7616)
This removes the dependency on global state and instead relies on the
runtime's internal state to get the script sources it saw when it
collected code coverage for them.
2020-09-22 13:59:02 +10:00
Casper Beyer
9caeff3208
fix(cli/repl): interpret object literals as expressions (#7591) 2020-09-21 16:09:53 -04:00
Luca Casonato
5c2e499c3a
fix: Response.arrayBuffer() doesn't return promise (#7618) 2020-09-21 22:07:41 +02:00
Bartek Iwańczuk
92edc36442
refactor: use futures and serde_json from deno_core (#7614) 2020-09-21 18:36:37 +02:00
William Perron
42772845f6
fix(info): add --importmap flag (#7424) 2020-09-21 15:07:19 +02:00
Casper Beyer
e06875e9f7
refactor(cli/coverage): await for inspector message response (#7584) 2020-09-21 15:02:58 +02:00
tokiedokie
c4ed3fb7e7
chore: add copyright (#7593) 2020-09-21 08:26:41 -04:00
Luca Casonato
dc6571909b
fix: make --watch and --inspect conflicting args (#7610) 2020-09-21 14:01:54 +02:00
Bartek Iwańczuk
d1b88510cf
refactor: remove GlobalState::compile_lock (#7598) 2020-09-21 11:41:51 +02:00
Nayeem Rahman
0a9d7e4e39
fix(cli/installer): Don't reload by default (#7596) 2020-09-20 14:05:11 +02:00
Yusuke Tanaka
db5004f200
fix(fmt,lint): do not print number of checked files when --quiet is enabled (#7579) 2020-09-20 13:49:22 +02:00
Nayeem Rahman
51019dc267
fix(cli/flags): Make --unstable a global flag (#7585) 2020-09-20 13:45:00 +02:00
Bartek Iwańczuk
b657d743a2
refactor: remove CliState, use OpState, add CliModuleLoader (#7588)
- remove "CliState.workers" and "CliState.next_worker_id", instead
store them on "OpState" using type aliases.
- remove "CliState.global_timer" and "CliState.start_time", instead
store them on "OpState" using type aliases.
- remove "CliState.is_internal", instead pass it to Worker::new
- move "CliState::permissions" to "OpState"
- move "CliState::main_module" to "OpState"
- move "CliState::global_state" to "OpState"
- move "CliState::check_unstable()" to "GlobalState"
- change "cli_state()" to "global_state()"
- change "deno_core::ModuleLoader" trait to pass "OpState" to callbacks
- rename "CliState" to "CliModuleLoader"
2020-09-20 01:17:35 +02:00
Nayeem Rahman
aaa5e6613a
fix(cli/rt): make some web API constructors illegal at runtime (#7468) 2020-09-19 23:30:59 +02:00
Casper Beyer
d3cce36701
refactor(cli/coverage): use json and error check protocol responses (#7577) 2020-09-19 14:01:56 +02:00
Bert Belder
d6f3de6feb
v1.4.1 2020-09-18 21:28:11 +02:00
Bartek Iwańczuk
f44522eac9
refactor: move fields from CliState to OpState (#7558)
- move rng to OpState
- move GlobalTimer to OpState
- move Metrics to OpState
2020-09-18 20:39:47 +02:00
Nayeem Rahman
4fcfff0393
fix(bundle, eval, repl): Add missing flags (#7414)
Restructures flag helpers and applies them consistently.
2020-09-18 13:09:11 -04:00
Ryan Dahl
526d668102
Use reqwest from deno_fetch export (#7562) 2020-09-18 13:07:09 -04:00
tokiedokie
4c2920ddd7
fix(cli/fmt): canonicalize files in current dir (#7508) 2020-09-18 13:03:37 -04:00
Casper Beyer
de95fbebc4
fix(cli/repl): format evaluation results with the object specifier (#7561) 2020-09-18 12:47:08 -04:00
Ryan Dahl
8edf099485
publish deno_fetch during CI (#7557) 2020-09-18 12:31:30 -04:00
Casper Beyer
93e8e59a7e
fix(cli/console): surround non alpha-numeric object keys with quotes (#7550) 2020-09-18 11:25:09 -04:00
Bartek Iwańczuk
ec174170ba
refactor: move FileReader to op_crates/web (#7554) 2020-09-18 16:01:50 +02:00
Casper Beyer
38196f7850
fix(cli/console): always quote and escape inspected strings (#7546) 2020-09-18 09:28:30 -04:00
Bartek Iwańczuk
7845740637
refactor: deno_fetch op crate (#7524) 2020-09-18 09:20:55 -04:00
Pig Fang
e4188f7dfb
fix(cli/fmt): make fmt output more readable (#7534) 2020-09-17 21:48:08 -04:00
Bartek Iwańczuk
d245ececb6
fix: disable rustyline logs (#7535) 2020-09-17 20:38:57 +02:00
Bartek Iwańczuk
6453cb7567
refactor: Move URL to op_crates/web (#7544) 2020-09-17 19:13:20 +02:00
Casper Beyer
a6f4559174
fix(cli/console): escape non printable characters in object entries (#7533) 2020-09-17 13:07:57 -04:00
Bartek Iwańczuk
c307e3e4be
refactor: use Symbol.for instead of Symbol in cli/rt/ (#7537) 2020-09-17 18:42:36 +02:00
Bartek Iwańczuk
bda9379385
refactor: move op_resources and op_close to deno_core (#7539)
Moves op_close and op_resources to deno_core::ops and exports them.
Adds serde dependency to deno_core and reexports it.

Moves JS implementation of those ops to Deno.core and reexports them in Deno.
2020-09-17 18:09:50 +02:00
Bartek Iwańczuk
3421f4dbbd
refactor: disable URL.createObjectUrl (#7543) 2020-09-17 17:35:05 +02:00
Ryan Dahl
3e98d9091f
fix: Use Buffer.writeSync in MultipartBuilder (#7542) 2020-09-17 17:03:05 +02:00
Ryan Dahl
46bf660e36
refactor: make fetch use op_fetch_read instead of op_read (#7529) 2020-09-17 16:11:55 +02:00
Bartek Iwańczuk
6c4da0e429
refactor: remove dispatch_json.js from cli/rt and cli/tsc (#7521)
Instead use Deno.core.jsonOpSync and Deno.core.jsonOpAsync
2020-09-16 22:22:43 +02:00
Ryan Dahl
104aebdfb5
Re-export deno_core::url (#7525)
Also re-exports deno_core::futures and deno_core::serde_json but these are not yet used in the CLI.
2020-09-16 14:28:07 -04:00
Ryan Dahl
c3ef358c01 Remove unnecessary extern statements 2020-09-16 13:29:42 -04:00
Ryan Dahl
0cb64cef76 Remove unnecessary serde_derive dependency 2020-09-16 13:29:42 -04:00
Bert Belder
21f2e45b0d
Revert "feat(install): bundle before installation" (#7522)
This reverts the changes introduced by PR #5276, which made
`deno install «script»` automatically bundle the script's dependencies.
It broke the `deno install` command for a large number of scripts.

This reverts commit 34e98fa59c.

Closes: #7492
2020-09-16 18:41:58 +02:00
Ryan Dahl
f58b10ec64
simplify global properties (#7502) 2020-09-16 12:41:01 -04:00
bartOssh
81ca7096c5
refactor(unstable): deno info --json output (#7417)
Provide flat JSON structured output.

Fix BrokenPipe error when piping out to "head".
2020-09-16 15:38:38 +02:00
Bartek Iwańczuk
d4a24c870e
Revert "fix(cli/http_utils): accept a single key-multiple values headers (#7375)" (#7515)
This reverts commit f5c84920c2.
2020-09-16 13:34:16 +02:00
Ryan Dahl
0715803b7f
Remove http_client from CliState, store in OpState directly (#7497) 2020-09-15 16:15:01 -04:00
Ryan Dahl
b2fa903d64 cli/msg.rs -> cli/media_type.rs 2020-09-15 11:55:51 -04:00
Ryan Dahl
68099acbc6 Don't expose ErrWithV8Handle from deno_core 2020-09-15 11:55:51 -04:00
tokiedokie
f5c84920c2
fix(cli/http_utils): accept a single key-multiple values headers (#7375) 2020-09-15 07:18:48 +02:00
tokiedokie
04d3472257
refactor(cli/tests): change std_path to root_path in std_tests() (#7438) 2020-09-15 06:26:57 +02:00
Ryan Dahl
055dfe2ff4
Make JsRuntimeState private (#7484) 2020-09-14 23:49:12 -04:00
Bartek Iwańczuk
7023263b30
refactor(core): remove JsRuntime::set_js_error_create_fn (#7478)
Instead use RuntimeOptions.js_error_create_fn
2020-09-14 21:23:48 -04:00
Ryan Dahl
70f070706d
Rename deno::state::State to deno::state::CliState (#7480) 2020-09-14 21:22:32 -04:00
Ryan Dahl
192b8f4b99
Remove unnecessary wildcard from ts_decorators test (#7485) 2020-09-14 21:22:03 -04:00
Bert Belder
f5b40c918c
refactor: use the 'anyhow' crate instead of 'ErrBox' (#7476) 2020-09-15 01:50:52 +02:00
Bert Belder
3da20d19a1
chore: fix clippy warnings (#7476) 2020-09-15 00:11:20 +02:00
Kitson Kelly
5248a711ff
chore: add some traits to ast.rs (#7479) 2020-09-14 23:59:49 +02:00
Bartek Iwańczuk
a65bcadcf2
test: reenable TS decorator test (#7471) 2020-09-14 18:59:54 +02:00
Kitson Kelly
a6f34d4722
refactor: use ParsedModule and improve MediaTypes enum (#7456) 2020-09-14 14:27:44 +02:00
tokiedokie
e688a701e2
test(cli/tests/https_import): use ts file in localhost instead of remote (#7431) 2020-09-14 13:18:00 +02:00
Nayeem Rahman
f874b83aa0
test(cli/tests/unit): Enable color for js_unit_tests (#7443) 2020-09-14 12:46:50 +02:00
Kitson Kelly
4baf61993c
chore: add no_check_hello benchmark (#7458) 2020-09-14 12:25:06 +02:00
Bert Belder
530f48d2fd Upgrade Rust crates, pin 'webpki-roots' to version 0.19.0 (#7454) 2020-09-14 00:20:56 +02:00
Bartek Iwańczuk
b3fa81f867
v1.4.0 2020-09-13 16:35:31 +02:00
Casper Beyer
755cfa98eb
feat(unstable): deno test --coverage (#6901)
This commit adds basic support for collecting coverage
data using "deno test". 

Currently the report is only a text added to the end
of output from "deno test".
2020-09-13 15:01:30 +02:00
Bartek Iwańczuk
b216d48e5f
upgrade: deno_doc, deno_lint, dprint, swc (#7434)
upgrades:
- swc_ecmascript 0.7.7
- dprint-plugin-typescript 0.31.3
- deno_lint 0.2.0
- deno_doc 0.1.9

Split std_lint test into std_lint and unit_test_lint.

Added lint ignores to CommonJS files in std/node.
2020-09-13 14:15:38 +02:00
Bert Belder
bf70442b08
upgrade: rusty_v8 0.10.0 / V8 8.7.75 (#7429) 2020-09-13 13:43:50 +02:00
Luca Casonato
daa780e2cf
fix(WebSocket): no panic on failed connect + handle promise rejection via error event (#7437) 2020-09-13 11:52:20 +02:00
Luca Casonato
82d0f7ec84
chore: remove --no-check from deno info (#7439) 2020-09-12 23:34:54 +02:00
Luca Casonato
d048f58f05
chore: add systemMemoryInfo unstable diagnostic (#7435) 2020-09-12 16:12:14 +02:00
Kitson Kelly
10fbfcbc79
refactor: improve tsc diagnostics (#7420) 2020-09-12 11:53:57 +02:00
Nayeem Rahman
5276cc8592
refactor: Improve placeholder module names (#7430) 2020-09-12 11:33:51 +02:00
Bartek Iwańczuk
60dbc6b294
Revert "feat(unstable): Support data: urls (#5157)" (#7432)
This reverts commit e3319f34a6.
2020-09-12 11:08:00 +02:00
Valentin Anger
e3319f34a6
feat(unstable): Support data: urls (#5157) 2020-09-11 22:40:48 +02:00
Bartek Iwańczuk
a3282aa9ed
feat(unstable): deno run --watch (#7382)
Co-authored-by: Sebastian Seedorf <mail@sebse.de>
2020-09-11 18:19:49 +02:00
Luca Casonato
fbb18d40d3
feat(unstable): enable importsNotUsedAsValues by default (#7413) 2020-09-11 16:22:10 +02:00
Bartek Iwańczuk
0d1f626edd
refactor(core): JsRuntime initialization (#7415)
Removes:
- "deno_core::StartupData"
- "deno_core::Script"
- "deno_core::OwnedScript"

Changes to "JsRuntime":
- remove "new_with_loader()"
- remove "with_heap_limits()"
- rename "IsolateOptions" to "RuntimeOptions" and make public
- "JsRuntime::new()" takes "RuntimeOptions" as a single param
2020-09-11 15:18:49 +02:00
Ryan Dahl
7c2e7c6608
Use gotham-like state for ops (#7385)
Provides a concrete state type that can be dynamically added. This is necessary for op crates.
* renames BasicState to OpState
* async ops take `Rc<RefCell<OpState>>`
* sync ops take `&mut OpState`
* removes `OpRegistry`, `OpRouter` traits
* `get_error_class_fn` moved to OpState
* ResourceTable moved to OpState
2020-09-10 09:57:45 -04:00
Nayeem Rahman
6f70e6e72b
feat(console): support CSS styling with "%c" (#7357) 2020-09-10 12:49:47 +02:00
Akshat Agarwal
c1b4ff61c9
feat(unstable): Add Deno.systemMemoryInfo() (#7350)
Co-authored-by: marcopacini <pacinim88@gmail.com>
Co-authored-by: Casper Beyer <caspervonb@pm.me>
2020-09-10 10:38:17 +02:00
Bartek Iwańczuk
2423a867c0
fix: panic on process.kill() after run (#7405)
This commit fixes panic caused by "unimplemented!()"
calls for some variants of "nix::errno::Errno".

Catch-all variant now returns "Error" class name
instead of panicking.

Co-authored-by: Bert Belder <bertbelder@gmail.com>
2020-09-09 22:40:16 +02:00
Bert Belder
839c59b14f
fix(cli): suppress 'WSANOTINITIALIZED' error on Deno exit (#7408)
Unblocks: #6901
2020-09-09 21:37:59 +02:00
Yusuke Tanaka
857f9b32e0
feat(fmt, lint): show number of checked files (#7312) 2020-09-09 16:45:31 +02:00
Bartek Iwańczuk
1fcbf9cb8a
upgrade: swc, deno_doc, deno_lint, dprint (#7402)
- deno_doc - 0.1.6
- deno_lint - 0.1.29
- dprint-plugin-typescript 0.31.1
- swc_ecmascript 0.7.3
2020-09-09 15:35:40 +02:00
Nayeem Rahman
b17a5fbcfa
fix(op_crates/web): Use "deno:" URLs for internal script specifiers (#7383) 2020-09-09 14:23:57 +02:00
Bartek Iwańczuk
c14436a424
fix(tsc): config resolution using relative paths (#7392) 2020-09-09 13:37:22 +02:00
uki00a
ac455050ee
feat(console): print proxy details (#7139) 2020-09-08 16:06:26 +02:00
Luca Casonato
6ff9395532
feat(unstable): enable isolatedModules by default (#7327) 2020-09-08 15:28:42 +02:00
Bartek Iwańczuk
241d228104
upgrade: deno_doc to 0.1.5 (#7391) 2020-09-08 13:02:14 +02:00
EathonYe
05c46f5969
fix(cli): colors mismatch (#7367) 2020-09-08 12:04:02 +02:00
David Sherret
ab7f93caf1
upgrade: dprint-plugin-typescript 0.31.0 (#7381) 2020-09-08 11:58:17 +02:00
Casper Beyer
1d0f1ed446
fix: Empty Response body returns 0-byte array (#7387) 2020-09-08 11:46:15 +02:00
KrisChambers
1cd2267500
feat(info): Dependency count and sizes (#6786)
This commit changes "deno info" subcommand logic.

- Modules are no longer loaded into V8 isolate - analysis
  is done using ModuleGraph.
- Removed deno_core::Deps structure.
- Modules are no longer type-checked and transpiled - 
  "compiled" file is shown only if it is already available.
- Added number of unique dependencies for root module.
- Changed tree output:
  - file size is shown next to the dependency
  - repeated dependencies are marked with "*"
  - used less spaces in prefix to save terminal width
2020-09-07 15:59:47 +02:00
Bartek Iwańczuk
f57a2c1e85
refactor(core): rename CoreIsolate to JsRuntime (#7373)
deno_core/
- rename core_isolate.rs to runtime.rs
- rename CoreIsolate to JsRuntime
- rename JSError to JsError
- rename JSStackFrame to JsStackFrame

cli/
- update references from deno_core::CoreIsolate to deno_core::JsRuntime
- rename deno_core::JSError to deno_core::JsError
- rename fmt_errors::JSError to fmt_errors::JsError
2020-09-06 21:44:29 +02:00
Bartek Iwańczuk
803bdd37c7
refactor(core): merge CoreIsolate and EsIsolate (#7370) 2020-09-06 16:50:49 +02:00
Bert Belder
c821e8f2f1
Move JSON ops to deno_core (#7336) 2020-09-06 02:34:02 +02:00
crowlKats
8c880d3261
feat: Implement WebSocket API (#7051) 2020-09-05 10:39:25 -04:00
Yoshiya Hinosawa
34e98fa59c
feat(install): bundle before installation (#5276) 2020-09-05 13:31:14 +02:00
Bartek Iwańczuk
a14b3c9e30
v1.3.3 2020-09-04 18:15:24 +02:00
Ryan Dahl
e7147786f4
run cargo update (#7348) 2020-09-04 11:24:23 -04:00
Kitson Kelly
9e50b3ee61
fix: don't expose globalThis.__bootstrap (#7344) 2020-09-04 07:52:19 -04:00
迷渡
c44c45a334
docs: fix anchor link (#7346) 2020-09-04 06:43:51 -04:00
Ryan Dahl
a10339cb20
fix: Handle bad redirects more gracefully (#7342) 2020-09-04 06:43:20 -04:00
Bartek Iwańczuk
2b43ce65ae
fix: regex for TS refereces and deno-types (#7333) 2020-09-04 10:44:31 +02:00
tokiedokie
fcee4265c6
support env_logger / RUST_LOG (#7142) 2020-09-03 16:16:49 -04:00
Bartek Iwańczuk
dbd941148c
refactor: use dependency analyzer from SWC (#7334) 2020-09-03 17:11:30 +02:00
Bartek Iwańczuk
c6ccaf064a
upgrade: swc, deno_doc, deno_lint, dprint (#7332) 2020-09-03 13:29:02 +02:00
Ryan Dahl
a4439800e6
Remove unnecessary stdout pipes in tests (#7322) 2020-09-02 18:31:22 +02:00
YellowBird
5db200b6ab
fix(docs): replace "eslint-ignore-" with "eslint-disable-" (#7319) 2020-09-02 12:03:35 +02:00
Luca Casonato
fe47da9f23
chore: multi line deno_lint diagnostics (#7303) 2020-09-02 11:39:20 +02:00
Bartek Iwańczuk
b21f318e68
fix: support missing features in --no-check (#7289)
This commit adds "EmitTranspileOptions" to "transpile()" function, 
that allows to configure transpilation process based on the 
currently loaded "tsconfig.json".
2020-09-02 11:12:18 +02:00
Ryan Dahl
050c865af4
deno_web 0.6.0 (#7317) 2020-09-02 00:02:05 +02:00
Ryan Dahl
ce63806c64
simplify deno_web init (#7313) 2020-09-01 16:32:07 -04:00
Yoshiya Hinosawa
b3563e8569
fix(URLSearchParams): fix handling of + character (#7314) 2020-09-01 20:34:41 +02:00
Casper Beyer
87e513ffc5
fix: use millisecond precision for Deno.futime and Deno.utime (#7299) 2020-09-01 10:03:07 -04:00
Casper Beyer
644190eed8
test(std): ensure mod.ts modules have a test coverage (#7264) 2020-08-31 22:26:55 -04:00
Casper Beyer
94d38eee4c
replace utime crate with filetime (#7268) 2020-08-31 22:24:17 -04:00
Michael Kurze
b751122e10
fix(doc): fix some typos in cli docs (#7292) 2020-08-31 22:18:06 -04:00
Ryan Dahl
4b5d8bdbaf
set maximum size of thread pool to 31 (#7290) 2020-08-31 17:38:25 -04:00
Casper Beyer
32de714dc7
feat(unstable): add Deno.futime and Deno.futimeSync (#7266) 2020-08-31 14:29:43 -04:00
Bartek Iwańczuk
c82c3b982e
refactor: Compiler config in Rust (#7228)
* port tsc_config.rs

* cleanup options

* bring back allowNonTsExtension

* try

* fix test

* fix test2

* move config for bundling

* remove Transpile compile request

* remove dead code

* remove more dead code

* remove checkJs regex

* fix

* handle config str for runtime APIs

* lint

* runtimeCompile config in Rust

* runtimeCompile and runtimeTranspile config in Rust

* fix

* remove lint supression

* upgrade: jsonc-parser 0.13.0

* remove unneeded to_string()

* upgrade: jsonc-parser 0.14.0

* remove AsRef<str>
2020-08-31 20:12:24 +02:00
Yusuke Tanaka
71f0171ab0
fix no-inner-declaration lint rule (#7287) 2020-08-31 14:11:17 -04:00
Trivikram Kamat
0071dfdc5c
update actions to run on ubuntu-18.04 (#7160) 2020-08-31 11:48:58 -04:00
Yusuke Tanaka
fa65e49bc6
feat(lint): Add support for reading input from stdin (#7263) 2020-08-31 13:53:42 +02:00
Casper Beyer
a451a97486
fix(cli): use upstream type definitions for WebAssembly (#7216) 2020-08-31 12:04:47 +02:00
Bartek Iwańczuk
5c23388f6d
upgrade: swc, deno_doc, deno_lint, dprint (#7276) 2020-08-31 11:48:44 +02:00
Yusuke Tanaka
7799b797d1
chore: remove unreachable code to pass linter (#7270) 2020-08-31 11:10:28 +02:00
Bartek Iwańczuk
d761246e16
refactor: remove dead code in tsc (#7277) 2020-08-31 11:02:13 +02:00
Bartek Iwańczuk
ac705b7936
v1.3.2 2020-08-29 09:53:13 -04:00
Yusuke Tanaka
0d11f3504b
fix(lint): use recommended rules set (#7222) 2020-08-29 12:58:20 +02:00
Nayeem Rahman
d6dc797d15
fix(URL): Add missing part assignment (#7239) 2020-08-29 10:12:10 +02:00
Yoshiya Hinosawa
00b6762412
test(cli/flags): restore disabled test cases (#7236) 2020-08-28 19:20:57 -04:00
Bartek Iwańczuk
7e946858a4
refactor: migrate ops to new dispatch wrapper (#7118) 2020-08-28 17:08:24 +02:00
Valentin Anger
31f32ed8c4
Move benchmarks to Rust (#7134)
All benchmarks are done in Rust and can be invoked with
`cargo bench`.

Currently this has it's own "harness" that behaves like
`./tools/benchmark.py` did.
Because of this tests inside `cli/bench` are currently not run.
This should be switched to the language provided harness
once the `#[bench]` attribute has been stabilized.
2020-08-28 09:03:50 -04:00
Nayeem Rahman
3d23208019
fix(deno install): Strip "@..." suffixes from inferred names (#7223) 2020-08-27 16:55:58 -04:00
Yusuke Tanaka
6d964fc607
test(url_test): disable no-self-assign rule here (#7204) 2020-08-26 15:01:03 -04:00
Bartek Iwańczuk
4a0bc747dd
upgrade: swc, deno_doc, deno_lint, dprint (#7194) 2020-08-26 20:43:24 +02:00
Luca Casonato
a7fd3a4f58
fix(cli): revert "never type check deno info #6978" (#7199) 2020-08-26 20:27:06 +02:00
Bert Belder
c8b5f1e454
Simplify ErrBox-to-class mapping & hook it up to core json ops (#7195) 2020-08-26 18:48:04 +02:00
Bert Belder
aead9dc91e
Remove some more unnecessary 'to_string()' calls (#7190) 2020-08-26 01:13:20 +02:00
Bert Belder
9bfb0df805
refactor: remove OpError, use ErrBox everywhere (#7187)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-08-26 00:22:15 +02:00
Kitson Kelly
c4d5b01acf
feat: update to TypeScript 4.0 (#6514) 2020-08-24 19:43:54 -04:00
Tuan Le
545ea8e217
fix(console): handle escape sequences when logging objects (#7171) 2020-08-24 12:38:21 -04:00
Rob Palmer
0cbf9bdbbd
Fix incorrect comment on useDefineForClassFields (#6386) 2020-08-24 18:37:30 +02:00
Casper Beyer
dcc7348090
test(cli): use assertThrows and assertThrowsAsync for chown tests (#7106) 2020-08-24 18:21:56 +02:00
Yoshiya Hinosawa
111a2fbe3e
refactor(cli/build.rs): extract ts version (#7127) 2020-08-24 17:52:05 +02:00
Bartek Iwańczuk
2600d5ac09
fix(doc): stack overflow for .d.ts files (#7167) 2020-08-23 15:48:35 +02:00
Bartek Iwańczuk
c1558beffb
upgrade: swc, dprint, deno_lint, deno_doc (#7162) 2020-08-23 13:57:09 +02:00
Nayeem Rahman
d444bd89db
fix(URL): Don't encode "'" in non-special query strings (#7152) 2020-08-21 22:35:34 -04:00
Bartek Iwańczuk
999e5cf3d4
v1.3.1 2020-08-21 18:11:33 +02:00
迷渡
9eca347f73
fix(docs): remove Deno.dir (#7144) 2020-08-21 15:56:12 +02:00
Nayeem Rahman
cf603be24c
fix: Allow isolated "%"s when parsing file URLs (#7108) 2020-08-21 15:37:06 +02:00
Kurt Mackey
cd67f7bdc8
fix: Create body stream from any valid bodySource (#7128)
Fixes #6752
2020-08-20 11:47:58 -04:00
Bartek Iwańczuk
be1e7ab532
refactor: move cli/doc/ to separate crate (#7103) 2020-08-19 19:13:43 +02:00
Luca Casonato
1507a8cf2d
refactor(op_crates/web): move abort signal (#7117) 2020-08-19 14:43:20 +02:00
Bert Belder
27f4aeb924
Make Rc/Arc wrapper around State/GlobalState visible (#7104) 2020-08-19 02:01:48 +02:00
Nayeem Rahman
015fa0bd41
refactor: permissions (#7074) 2020-08-18 16:29:32 -04:00
Bert Belder
f6e9150b33
Async op dispatcher support with 'stateful_json_op_(a)sync()' (#7095)
Closes: #7020
2020-08-18 20:50:52 +02:00
Bert Belder
b308a774e8
Fix nightly and Windows-only clippy warnings (#7095) 2020-08-18 20:50:52 +02:00
Bartek Iwańczuk
36c2855932
upgrade: swc, deno_lint, dprint (#7098) 2020-08-18 20:11:13 +02:00
Casper Beyer
3c986ca524
test(cli): use assertThrowsAsync for permission tests (#7092) 2020-08-18 11:05:51 -04:00
Bartek Iwańczuk
9f1dcc1a32
refactor(doc): add helper functions for DocNode (#7083) 2020-08-18 00:15:04 +02:00
crowlKats
b44b7a9a60
Blob.arrayBuffer returns uint8array (#7086) 2020-08-17 17:46:08 -04:00
Joel Chippindale
1f7d4089f9
Fix handling of multiple spaces in URLSearchParams (#7068)
This ensures that all spaces are set to be "+" in the string rather than
just the first and brings deno into line with how browsers handle spaces
in URLSearchParams, see #7001.
2020-08-17 14:52:45 -04:00
Tomofumi Chiba
b684df784e
fix: add NO_PROXY to deno help and add test (#7048) 2020-08-15 09:48:29 -04:00
Casper Beyer
4b3a3d9d0f
Enable WebAssembly.instantiateStreaming (#7043) 2020-08-14 13:48:37 -04:00
Jarrett Helton
ac56512ba4
fix: Dash Value Treated As Arg (#7039) 2020-08-14 13:45:22 -04:00
Casper Beyer
238816d62f
refactor(cli/rt): inline single line single use open helper functions (#7046) 2020-08-14 13:43:11 -04:00
Kitson Kelly
27d8969847
chore: nightly clippy refactor in lint.rs (#7045) 2020-08-14 12:40:29 +02:00
Bartek Iwańczuk
b38c313276
v1.3.0 2020-08-13 12:10:13 -04:00
souldzin
d6cee70695
feat: Add "--json" flag to deno lint (#6940)
Co-authored-by: JackSkylark <jdslaughter44@gmail.com>
2020-08-13 17:30:46 +02:00
Bartek Iwańczuk
08ab4d46ca
upgrade: swc, deno_lint, dprint (#7040) 2020-08-13 11:03:16 -04:00
Divy Srivastava
ad4af23aba
unify path normalization utility (#6865) 2020-08-12 16:34:17 -04:00
Ryan Dahl
c4d9c6aa4b
upgrade: TypeScript to 3.9.7 (#7036) 2020-08-12 20:49:02 +02:00
Jarrett Helton
de4e1fbdf0
feat: add support for --no-check flag in Deno install (#6948) 2020-08-12 14:22:06 -04:00
Nayeem Rahman
18ec1290af
feat: Support file URLs in Deno.run for executable (#6994) 2020-08-12 14:20:34 -04:00
Bert Belder
3d70a2b94e
upgrade: Rust crates
The following crates were _not_ upgraded to avoid having multiple
versions of the same crate in the dependency tree:
  * tokio-tungstenite v0.10.1 -> v0.11.0
  * swc_common        v0. 8.0 -> v0. 9.1
  * swc_ecmascript    v0. 1.0 -> v0. 3.0
  * webpki-roots      v0.19.0 -> v0.20.0
  * nix               v0.17.0 -> v0.18.0
2020-08-12 17:45:15 +02:00
Jarrett Helton
c4edd09816
feat(bundle): add support for --reload flag (#6996) 2020-08-12 17:32:03 +02:00
Ryan Dahl
f5a4f1fdc0
Undo JsonOpDispatcher and OpDispatcher traits (#7023)
This reverts commit f83d672ffa.
This reverts commit d51972377c.
2020-08-12 16:44:58 +02:00
Divy Srivastava
6706eb5515
feat: add "--ignore" to deno lint (#6934) 2020-08-12 15:47:44 +02:00
Nayeem Rahman
fed70c9903
feat: deno info --reload (#7009) 2020-08-12 12:58:50 +02:00
Prabhanjan
b344a7f81f
fix: URLSearchParams.toString() behaviour is different from browsers (#7017) 2020-08-12 12:08:24 +02:00
Paul Thompson
eed77aa020
feat(web): FileReader API (#6673) 2020-08-11 14:00:53 +02:00
Valentin Anger
d7077b9073
doc: Remove detailed / summary distinction (#6818) 2020-08-11 11:06:55 +02:00
迷渡
dad74c3706
remove unnecessary await in docs (#7012) 2020-08-10 23:22:10 -04:00
Luca Casonato
da98f9e3a1
fix(unstable): add missing globals to diagnostics (#6988) 2020-08-10 18:08:12 -04:00
Ryan Dahl
7d01fcbb77
Remove unnecessary drop calls (#7007) 2020-08-10 17:31:05 -04:00
Nayeem Rahman
52c1017a74
feat: Stabilize Deno.mainModule (#6993) 2020-08-10 16:41:51 -04:00
Bartek Iwańczuk
6fcf06306e
feat(doc): handle imports (#6987)
This commit adds additional objects to JSON output
of "deno doc" command to facilitate linking between 
types in different modules.
2020-08-10 17:41:19 +02:00
uki00a
67fe8cd848
fix: console.log should see color codes when grouping occurs (#7000) 2020-08-09 19:09:09 -04:00
Ryan Dahl
92a173bca6
v1.2.3 2020-08-08 18:59:16 -04:00
Bert Belder
604d008190
test(cli/wasm_unreachable): don't assume git work dir is named 'deno' (#6991) 2020-08-08 22:06:44 +02:00
Bert Belder
febb972dd4
test(cli/stat_test): older versions of Linux don't support birthtime (#6991) 2020-08-08 22:06:44 +02:00
Bert Belder
f17eb634fa
test(cli/inspector_port_collision): skip test on WSL (#6991) 2020-08-08 22:06:44 +02:00
Bert Belder
9806933f57
test(cli/inspector_port_collision): fail rather than hang (#6991) 2020-08-08 22:06:44 +02:00
Bert Belder
f22b7dc783
fix(cli): show error on unrecognized V8 flag, exit on --help (#6980) 2020-08-08 21:23:21 +02:00
Bartek Iwańczuk
165928d5dc
upgrade: deno_lint v0.1.21 (#6985) 2020-08-08 16:20:21 +02:00
Bartek Iwańczuk
59ca66a207
Encode op errors as strings instead of numbers (#6977) 2020-08-07 16:47:18 -04:00
Nayeem Rahman
479164d287
fix(deno info): Never type check (#6978) 2020-08-07 16:46:54 -04:00
Bartek Iwańczuk
41215eb29c
Op crate for Web APIs (#6906)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-08-07 16:55:02 +02:00
Luca Casonato
f6cd36f8c8
fix: add missing globals to unstable diagnostics (#6960) 2020-08-05 16:17:45 -04:00
Luca Casonato
ce7808baf0
feat(cli): custom http client for fetch (#6918) 2020-08-05 20:44:03 +02:00
Luca Casonato
91ed614aa8
fix(cli/dts): MDN attribution in JSDoc for Console.dirxml (#6961) 2020-08-05 20:21:20 +02:00
Bartek Iwańczuk
55ea9c7e85
refactor: remove repeated code in main.rs (#6954) 2020-08-04 16:08:41 +02:00
josephrocca
8bacd710db
docs: Removed unnecessary await (#6951) 2020-08-04 12:16:04 +02:00
Maayan Hanin
5fc5e7b54a
fix(cli): add support for non-UTF8 source files (#6789)
Fixes: #5542
2020-08-03 23:39:48 +02:00
Luca Casonato
9d50c5c1a6
feat: hash file names in gen cache (#6911) 2020-08-03 14:55:03 +02:00
Ryan Dahl
7446230e6b
v1.2.2 2020-07-31 15:14:25 -04:00
Bartek Iwańczuk
b718e6ff53
upgrade: deno_lint, dprint, swc (#6928)
This commit upgrades:
deno_lint 0.1.20
dprint-plugin-typescript 0.25.0
swc_ecmascript 0.1.0

SWC is no longer reexported from dprint nor deno_lint.
2020-07-31 16:59:22 +02:00
Nayeem Rahman
6e7208bec2
fix(cli/rt): Fix file URL to path conversion on Windows (#6920) 2020-07-30 18:37:26 -04:00
Divy Srivastava
0da4779b17
feat(unstable): add "--ignore" flag to deno fmt (#6890) 2020-07-30 12:09:08 -04:00
Bartek Iwańczuk
c691713394
refactor: Use SWC to strip types for "--no-check" flag (#6895) 2020-07-28 22:33:23 +02:00
Bartek Iwańczuk
315efbc0e8
fix: downcast from SwcDiagnosticBuffer to OpError (#6909) 2020-07-28 15:08:13 -04:00
Kitson Kelly
076547fbbb
chore: use matches macro for bool matches (#6904) 2020-07-28 09:50:45 -04:00
Mark Tiedemann
9f3ab4dca7
Shorten Windows file description (#6881) 2020-07-26 10:39:34 -04:00
Trivikram Kamat
017aa1ca1b
chore: remove TODO about manual JSON parsing (#6878) 2020-07-26 14:55:39 +02:00
Bartek Iwańczuk
69552b1def
upgrade: deno_lint v0.1.17 (#6869) 2020-07-25 17:47:55 +02:00
Bartek Iwańczuk
b45f9a7357
fix: deno-types directive should have higher precedence than X-TypeScript-Types header (#6761) 2020-07-24 14:21:36 +02:00
Ryan Dahl
25a0ad3e16
v1.2.1 2020-07-24 06:32:48 -04:00
Nayeem Rahman
a8f74aa381
fix: Improve URL compatibility (#6807)
- Fix protocol regex.
- Truncate repeated leading slashes in file paths.
- Make drive letter support platform-independent.
- Drop the hostname if a drive letter is parsed.
- Fix drive letter normalization and basing.
- Allow basing over the host.
- Fix same-protocol basing.
- Remove Windows UNC path support.
- Reverts #6418. This is non-standard. Wouldn't be too much of a problem but it 
   makes other parts of the spec hard to realize.
2020-07-23 21:37:11 -04:00
Nayeem Rahman
b61347b255
fix(cli/js/ops/fs_events): Ignore polling errors caused by return() (#6785) 2020-07-23 21:33:52 -04:00
Ryan Dahl
c2507d95f5
Align cargo dependency features (#6860) 2020-07-23 13:20:08 -04:00
Ryan Dahl
218be6a269
Don't use window.__base64. Combine deno_ns scripts. (#6858) 2020-07-23 11:12:25 -04:00
Ryan Dahl
ca4dcb36dd
Rename cli/js2 to cli/rt (#6857) 2020-07-23 16:27:26 +02:00
Bartek Iwańczuk
b449964d1a
refactor: remove more compiler runtime code (#6841) 2020-07-23 15:29:36 +02:00
Bartek Iwańczuk
b573bbe447
upgrade: tokio 0.2.22 (#6838) 2020-07-23 00:23:52 +02:00
Casper Beyer
587eefe773
test(cli/unit): remove rogue console.log statement (#6846) 2020-07-22 16:46:43 -04:00
Ryan Dahl
f8695b493d
Add web APIs to cli/js2/README.md (#6842) 2020-07-22 19:30:59 +02:00
Ryan Dahl
69706331a5
clean up set_binary_metadata (#6811) 2020-07-22 13:19:37 -04:00
Ryan Dahl
bf9930066d
Reduce size of TypeScript Compiler snapshot (#6809)
This PR is intentionally ugly. It duplicates all of the code in cli/js2/ into
cli/tsc/  ... because it's very important that we all understand that this code
is unnecessarily duplicated in our binary. I hope this ugliness provides the
motivation to clean it up.

The typescript git submodule is removed, because it's a very large repo and
contains all sorts of stuff we don't need. Instead the necessary files are
copied directly into the deno repo. Hence +200k lines.

COMPILER_SNAPSHOT.bin size
```
master         3448139
this branch    3320972
```

Fixes #6812
2020-07-22 12:03:46 -04:00
crowlKats
9d13b539b5
Fix lastModified for DomFile in FormData (#6830) 2020-07-22 08:04:35 -04:00
Ryan Dahl
2460689b1a
Remove deno_typescript (#6813) 2020-07-20 19:49:57 -04:00
crowlKats
903d28f872
Remove duplicate code and allow filename overwrite for DomFile (#6817) 2020-07-20 11:29:47 -04:00
Bartek Iwańczuk
fa61956f03
Port internal TS code to JS (#6793)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-07-19 19:49:44 +02:00
Bert Belder
faa64edaf4
Upgrade to rusty_v8 0.7.0 (#6801) 2020-07-19 01:47:45 +02:00
Luca Casonato
071a6e284a
Share reqwest client between fetch calls (#6792) 2020-07-18 15:05:08 -04:00
Bartek Iwańczuk
6e34f6a7cc
fix: providing empty source code for missing compiled files (#6760)
This commit adds a fallback mechanism for absent compiled source file.

Because imported type declaration files are not emitted by TS compiler
and their imports are not elided users often hit "No such file or directory"
error. With this commit in such situation an empty source file will be
provided to V8 with a warning to the user suggesting using "import type"/
"export type" syntax instead.
2020-07-17 15:50:17 +02:00
JohannLai
d60f9c2549
fix(cli/js/web): IPv6 hostname should be compressed (#6772) 2020-07-16 12:08:29 -04:00
Ryan Dahl
6c637f04bf
refactor(cli): Remove dead code (#6765) 2020-07-16 10:53:58 +02:00
Bartek Iwańczuk
98e0ed54db
fix: ModuleSpecifier removes relative path parts (#6762) 2020-07-16 10:53:07 +02:00
Maayan Hanin
b0f2bd4a2d
fix(cli): add icon and metadata to deno.exe on Windows (#6693)
Co-authored-by: Mark Tiedemann <www.marktiedemann@gmail.com>
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
Co-authored-by: Bert Belder <bertbelder@gmail.com>
2020-07-15 21:54:38 +02:00
Bartek Iwańczuk
73a9036089
fix: panic for runtime error in TS compiler (#6758) 2020-07-15 14:23:17 +02:00
David Sherret
cde4dbb351
Use dprint for internal formatting (#6682) 2020-07-14 15:24:17 -04:00
Gurwinder Singh
f83d672ffa
refactor: new trait JsonOpDispatcher (#6742) 2020-07-14 14:22:02 -04:00
Gurwinder Singh
d51972377c
refactor: Make OpDispatcher a trait (#6736) 2020-07-13 16:19:51 -04:00
Bartek Iwańczuk
6af5149ea3
v1.2.0 2020-07-13 13:00:24 -04:00
Maayan Hanin
d619e3c7ac
fix(cli): don't panic when no "HOME" env var is set (#6728) 2020-07-13 18:24:54 +02:00
Bartek Iwańczuk
11560387bb
Revert "feat: move unstable Deno.permissions to navigator.permissions… (#6729)
* Revert "feat: move unstable Deno.permissions to navigator.permissions (#6244)"

This reverts commit 202e7fa6ad.
2020-07-13 18:23:24 +02:00
Marcos Casagrande
44187c81f4
test: ignore max buffer tests (#6732) 2020-07-13 15:40:48 +02:00
uki00a
4731f4800c
fix(Deno.ppid): improve error message when --unstable is missing (#6717) 2020-07-13 14:00:56 +02:00
Marcos Casagrande
1a96a96e10
feat(cli): add copy argument to Buffer.bytes (#6697) 2020-07-13 00:58:59 -04:00
Nayeem Rahman
63edeb1c36
fix(cli/js/web/url): Implement IPv4 hostname parsing (#6707) 2020-07-13 00:56:45 -04:00
Marcos Casagrande
4aeac64ecd
fix(cli/fetch): fix relative redirect (#6715) 2020-07-13 00:53:36 -04:00
Kitson Kelly
dd59bf5fc3
fix: more tolerant performance.measure unit tests (#6726)
Fixes #6725
2020-07-13 00:50:57 -04:00
Oscar Linde
3be2064803
feat(cli): add DENO_CERT environment variable (#6370) 2020-07-12 19:18:27 -04:00
simwipado
e1d8140552
feat(install): add --config flag (#6204)
This commits adds support for "--config" flag in "deno install"
subcommand. Specified configuration file is copied alongside
source code to installation directory.
2020-07-12 15:05:47 +02:00
Valentin Anger
3374c73fba
feat(doc): Improve terminal printer (#6594)
- Add more support for generics
- Add the --private flag - displays documentation for
  not exported and private nodes
- Display more attributes like abstract, static and readonly
- Display type aliases
- Refactor module to use the Display trait
- Use a bit more color
2020-07-12 14:16:33 +02:00
Bartek Iwańczuk
871f9255e3
fix: harden pragma and reference parsing in module analysis (#6702) 2020-07-11 18:30:30 +02:00
Bartek Iwańczuk
a26b4a9f1e
chore: reenable ignored integration tests (#6703) 2020-07-11 18:29:55 +02:00
Bartek Iwańczuk
98f6a5a47d
chore: upgrade deno_lint, remove direct dprint dep (#6679)
This PR removes direct dependency on dprint-plugin-typescript 
and swc_ecma_visit. Both of these dependencies have been 
pushed out to deno_lint crate. This should make it a bit easier 
to do the upgrades and prevent having conflicting crate requirements.
2020-07-11 11:47:06 +02:00
Nayeem Rahman
5ec41cbcc2
feat(Deno.inspect): Add sorted, trailingComma, compact and iterableLimit to InspectOptions (#6591) 2020-07-11 00:52:18 -04:00
Kitson Kelly
40d081d3d9
feat: add performance user timing APIs (#6421) 2020-07-10 22:38:15 -04:00
Nayeem Rahman
69e0886362
fix(URL): Implement spec-compliant host parsing (#6689) 2020-07-10 15:51:24 -04:00
Marcos Casagrande
39dba12a06
fix(cli/buffer): allow Buffer to store MAX_SIZE bytes (#6570) 2020-07-10 11:49:35 -04:00
Sebastien Filion
1bcc35b84a
feat(unstable): add Deno.consoleSize (#6520) 2020-07-10 10:07:12 -04:00
Maayan Hanin
edb7a0eead
fix(cli): panic when stdio is null on windows (#6528)
Fixes: #6409
2020-07-09 21:06:51 +02:00
Kitson Kelly
202e7fa6ad
feat: move unstable Deno.permissions to navigator.permissions (#6244) 2020-07-09 05:00:18 -04:00
Valentin Anger
be7e0f2d49
BREAKING(core): Remove control slice from ops (#6048) 2020-07-08 11:23:50 -04:00
Emmanuel
cbbd944359
feat(cli): json option for "deno info" (#6372) 2020-07-08 10:50:12 -04:00
uki00a
a2bf61d1ae
feat(unstable): Deno.ppid (#6539) 2020-07-08 10:35:45 -04:00
Marcos Casagrande
231899695d
feat(cli): Add WriteFileOptions to writeTextFile & writeTextFileSync (#6280) 2020-07-08 09:38:22 -04:00
Kitson Kelly
82aabb657a
feat: add --no-check option (#6456)
This commit adds a "--no-check" option to following subcommands:
- "deno cache"
- "deno info"
- "deno run"
- "deno test"

The "--no-check" options allows to skip type checking step and instead 
directly transpiles TS sources to JS sources. 

This solution uses `ts.transpileModule()` API and is just an interim
solution before implementing it fully in Rust.
2020-07-08 11:26:39 +02:00
Marcos Casagrande
e4899b6ba4
perf(cli/body): improve .arrayBuffer() speed (#6669) 2020-07-07 22:25:34 -04:00
Sebastien Filion
4534db656d
feat(test): Add support for regex in filter flag (#6343)
Currently, the documentation makes it sound like the test subcommand's filter
flag could accept some kind of pattern matching value like a glob or a regex,
although the function "createFilterFn" accepts a regex as an argument, there's
no way to pass an actual regex value from the CLI.

This commit makes it possible to pass a string that could be cast as regex 
when string matches "^/.*/$".

With this change, a user can use the filter flag as follow:

deno test --filter "/test-.+/"

Also tested that `\` get escaped properly, on MacOS at least, and this is 
also a valid flag:

deno test --filter "/test-\d+/"
2020-07-07 15:13:38 +02:00
Takahiko Inayama
14a44464a6
feat: add lockfile support to bundle (#6624) 2020-07-07 13:05:28 +02:00
Nayeem Rahman
61d9952ff9
fix(cli/js/process): Fix process socket types (#6676) 2020-07-07 12:21:49 +02:00
Stanislav
158ae0bfe9
clean up code in cli/js (#6611) 2020-07-06 21:45:39 -04:00
uki00a
ab4c574f52
fix: Deno.setRaw shouldn't panic on ENOTTY (#6630) 2020-07-06 18:26:34 -04:00
crowlKats
2b52e3daf1
feat: deno upgrade --output (#6352) 2020-07-06 18:21:26 -04:00
Ryan Dahl
5c43131be1
Fix definition of URL constructor (#6653) 2020-07-06 17:39:13 -04:00
Ryan Dahl
8788553247
chore: Only use one set of tokio features (#6655) 2020-07-06 09:53:36 -04:00
dubiousjim
6b78729ba8
feat: Deno.chown() make uid, gid args optional (#4612) 2020-07-06 13:15:13 +02:00
Jacob Gee-Clarke
79610378d3
feat(cli): Added support for the --cert flag with 'deno upgrade' (#6609) 2020-07-05 23:58:23 -04:00
Bartek Iwańczuk
d1289db1c3
chore: re-enable tests using media_types (#6642) 2020-07-05 23:09:50 -04:00
Marcos Casagrande
3b4260dc54
fix(cli/fetch): response constructor default properties (#6650) 2020-07-05 21:37:18 -04:00
Kitson Kelly
4f60a0b3bd
chore: improve type safety of cli/js/compiler (#6647) 2020-07-05 20:13:27 -04:00
Marcos Casagrande
f85a0ce634
refactor(cli/body): use Deno.Buffer in bufferFromStream (#6632) 2020-07-05 18:05:38 -04:00
Bert Belder
e4e80f20c2
fix(tools): command line args parsing bug, unused function parameter (#6629) 2020-07-04 19:15:03 -04:00
Kyle June
d52e4007c8
Update timers to ignore Date Override (#6552) 2020-07-04 15:16:27 -04:00
Ryan Dahl
5f9e600c5b
chore: port http_server.py to rust (#6364) 2020-07-04 13:05:01 -04:00
Casper Beyer
fca492907c
test(cli): enable realpath symlink tests on Windows (#6627) 2020-07-04 16:54:20 +02:00
Bartek Iwańczuk
be07aaed84
v1.1.3 2020-07-03 15:35:19 -04:00
Bartek Iwańczuk
2b0dc32718
upgrade: dprint-typescript-plugin 0.19.5, deno_lint 0.1.15 (#6614) 2020-07-03 15:55:34 +02:00
Kitson Kelly
2527a6e296
fix: move ImportMeta to deno.ns lib (#6588) 2020-07-03 12:44:45 +02:00
Bartek Iwańczuk
cc12e86fe3
refactor: lock file (#6569)
- refactor lock file creation
- provide deterministic output in lock file (alphabetically sorted)
- dynamic imports are checked against lock file
2020-07-02 17:54:51 +02:00
Jacob Gee-Clarke
74c260517a
fix: net permissions didn't account for default ports (#6606) 2020-07-02 10:16:41 -04:00
Casper Beyer
8a14eafaff
doc: add unstable note to Deno.ftruncateSync and ftruncate (#6590) 2020-07-02 09:34:19 -04:00
Bartek Iwańczuk
851344f2ed
upgrade: swc_ecma_visit, dprint, deno_lint (#6580) 2020-07-01 16:04:56 +02:00
Kitson Kelly
062d1a41ea
refactor: Improvements to TsCompiler and its tests (#6576) 2020-06-30 13:10:51 +02:00
Andrey Filatkin
a690a20679
fix(cli/upgrade): upgrade fails on Windows with space in temp path (#6522) 2020-06-29 09:13:07 -04:00
Valentin Anger
db36857288
refactor: util functions take slices instead of heap values (#6547) 2020-06-29 14:17:37 +02:00
Valentin Anger
660f86f1a2
fix(cli/doc): doc printer missing [] around tuple type (#6523) 2020-06-28 10:35:12 -04:00
Marcos Casagrande
89ebe2079b
fix(cli/body): Maximum call stack size exceeded error (#6537) 2020-06-28 10:31:56 -04:00
Casper Beyer
aeadf8189a
fix(cli): change seek offset type from i32 to i64 (#6518) 2020-06-27 15:58:35 -04:00
David Sherret
0b28c80e9a
Update to dprint-plugin-typescript 0.19.3 (#6527) 2020-06-27 15:55:46 -04:00
Marcos Casagrande
6c093c0b5a
fix(cli): Buffer.bytes() ArrayBuffer size (#6511) 2020-06-27 13:52:27 +02:00
Nayeem Rahman
d77a55a973
fix(cli/js/process): Fix conditional types for process sockets (#6275) 2020-06-27 13:44:02 +02:00
Bartek Iwańczuk
5bc130be27
v1.1.2 2020-06-26 17:45:12 -04:00
Maayan Hanin
598a7dcc84
fix(cli/permissions): panic on hostless URLs (#6500) 2020-06-26 17:37:03 -04:00
Ryan Dahl
42464e922d
'Compile' messages changed to 'Check' messages (#6504) 2020-06-26 16:59:08 -04:00
Bert Belder
e10d74a3d3
Upgrade to rusty_v8 0.4.2 / V8 8.5.216 (#6503) 2020-06-26 20:17:15 +02:00
Bert Belder
0c735ebdc7
Fix clippy warning (#6503) 2020-06-26 20:16:49 +02:00
Andrey Filatkin
b049504bee
fix(cli/disk_cache): Support UNC paths in the typescript DiskCache (#6495) 2020-06-26 13:25:13 -04:00
Casper Beyer
e278c90d8a
feat(unstable): add Deno.fdatasyncSync and fdatasync (#6403) 2020-06-26 08:36:35 -04:00
Nayeem Rahman
ed0b1d4627
fix(cli/js/web/url): Support UNC paths on Windows (#6418) 2020-06-26 08:34:17 -04:00
Casper Beyer
175867ab76
fix(cli): strings shouldn't be interpreted as file URLs (#6412) 2020-06-26 08:29:34 -04:00
Kitson Kelly
70463bac7d
fix: Omit buildinfo when --reload passed (#6489) 2020-06-26 08:23:25 -04:00
Bartek Iwańczuk
4817c153e4
Re-land "fix(cli): ipv6 parsing for --allow-net params" (#6472)
With some minor adjustments
2020-06-26 08:09:02 -04:00
Ali Hasani
150c04aea7
remove duplicate identifier (#6483) 2020-06-25 21:14:42 +02:00
Luca Casonato
4102a19585
fix: panic when process stdio rid is 0 or invalid (#6405) 2020-06-25 12:38:19 -04:00
Kitson Kelly
6f09b8de41
Restore stats for incremental compile (#6474) 2020-06-25 15:50:16 +02:00
Casper Beyer
a455a0babf
Fix readLinkSync and readLink tests on Windows (#6463) 2020-06-25 07:27:23 -04:00
Casper Beyer
ab0f12fcb8
Remove stale comment referring to deleted code (#6462) 2020-06-25 07:08:42 -04:00
Casper Beyer
87f8f99c49
refactor(cli/tests/unit) to use assertThrows (#6459) 2020-06-25 00:57:08 +02:00
Bartek Iwańczuk
6bbe52fba3
Revert "fix(cli): ipv6 parsing for --allow-net params (#6453)" (#6458) 2020-06-25 00:41:13 +02:00
Ryan Dahl
0620862605
Clean up some fetch_remote_source tets (#6446) 2020-06-24 14:12:04 -04:00
Bartek Iwańczuk
3cbd1075c7
Incremental compilation for TypeScript (#6428)
This commit adds incremental compilation capabilities to internal TS compiler.

Instead of using "ts.createProgram()" API for compilation step (during deno 
startup), "ts.createIncrementalProgram()" API is used instead.

Thanks to TS' ".tsbuildinfo" file that already stores all necessary metadata
for compilation I was able to remove our own invention that is ".graph" file. 
".tsbuildinfo" file is stored alongside compiled source and is used to 
cache-bust outdated dependencies, facilitated by the "version" field. 
The value for "version" field is computed in Rust during loading of module 
graph and is basically a hash of the file contents.

Please keep in mind that incremental compilation is only used for initial 
compilation (or dynamic imports compilation) - bundling and runtime compiler 
APIs haven't been changed at all.

Due to problems with source map I changed compilation settings to inline 
source map (inlineSourceMap instead of sourceMap).
2020-06-24 16:59:12 +02:00
Nayeem Rahman
3314b46321
fix(cli/js/web/console): Improve string quoting behaviour (#6457) 2020-06-24 09:47:05 -04:00
Colin Harrington
702547d65a
fix(cli): ipv6 parsing for --allow-net params (#6453)
Co-authored-by: Liming Jin <jinliming2@gmail.com>
2020-06-24 09:43:29 -04:00
Kitson Kelly
1d8fc39494
Add ability to output compiler performance information (#6434) 2020-06-24 11:58:23 +02:00
Chris Couzens
f6a4146973
fix(cli/web): Support URLSearchParam as Body (#6416)
The following used to fail in Deno despite working in the browser:

```javascript
new Request('http://localhost/', {method: 'POST', body: new URLSearchParams({hello: 'world'})}).text().then(console.log)
```
2020-06-23 23:56:05 -04:00
Casper Beyer
6b3be01a00
feat(unstable): add Deno.fstatSync and fstat (#6425) 2020-06-22 08:58:52 -04:00
Bartek Iwańczuk
79adc7b000
core: add Deno.core.dispatchByName (#6395)
This commit adds alternate dispatch method to core JS API.

"Deno.core.dispatchByName()" works like "Deno.core.dispatch()", 
but takes op name instead of op id as a first argument.
2020-06-21 16:34:43 +02:00
Casper Beyer
40866d7cd5
feat(unstable): add Deno.fsyncSync and fsync (#6411) 2020-06-21 09:29:44 -04:00
Ryan Dahl
0a81ec6b1e
Remove Deno.dir and dirs dependency (#6385) 2020-06-20 23:49:27 -04:00
Casper Beyer
86f92e04c7
feat(unstable): add Deno.ftruncate and ftruncateSync (#6243) 2020-06-20 09:46:10 -04:00
Ryan Dahl
bdf2d26ba1
v1.1.1 2020-06-19 14:48:14 -04:00
Ryan Dahl
cddaacc955
upgrade crates (#6378) 2020-06-19 13:44:28 -04:00
Fallenhh
1c5ab8bf1a
refactor(cli/checksum): use map to generate hex string (#6382) 2020-06-19 11:03:33 -04:00
Bartek Iwańczuk
826a3135b4
refactor(compiler): split code paths for compile and bundle (#6304)
* refactor "compile" and "runtimeCompile" in "compiler.ts" and factor out
separate methods for "compile" and "bundle" operations

* remove noisy debug output from "compiler.ts"
 
* provide "Serialize" implementations for enums in "msg.rs"

* rename "analyze_dependencies_and_references" to "pre_process_file" and
move it to "tsc.rs"

* refactor ModuleGraph to use more concrete types and properly annotate
locations where errors occur

* remove dead code from "file_fetcher.rs" - "SourceFile.types_url" is no
longer needed, as type reference parsing is done in "ModuleGraph"

* remove unneeded field "source_path" from ".meta" files stored for
compiled source file (towards #6080)
2020-06-19 12:27:15 +02:00
uki00a
345a5b3dff
fix: "deno test" should respect NO_COLOR=true (#6371) 2020-06-19 12:10:31 +02:00
Alan Gou
ffedbd79ad
build: lint cli/tests/unit using deno lint (#6327) 2020-06-19 11:05:37 +02:00
Marcos Casagrande
36ad5e4402
refactor(cli/web): use isTypedArray method (#6369) 2020-06-18 14:39:29 -04:00
Bartek Iwańczuk
90c5dcfe79
chore(test): move testing utilities to test_util crate (#6360) 2020-06-18 11:54:55 -04:00
Ryan Dahl
a2969ecd27
Deno.bundle supports targets < ES2017 (#6346)
This commit provides a "system_loader_es5.js" bundle loader which will be added
to the bundle when the target is < ES2017, which is the minimum target syntax
required for "system_loader.js".

Supports #5913 (via Deno.bundle()) with a couple caveats:

* Allowing "deno bundle" to take a different target is not supported, as we
specifically ignore "target" when passed in a TypeScript config file. This is
because deno bundle is really intended to generate bundles that work in Deno.
It is an unintentional side effect that some bundles are loadable in browsers.

* While a target of "es3" will be accepted, the module loader will still only be
compatible with ES5 or later. Realistically no one should be expecting bundles
generated by Deno to be used on IE8 and prior, and there is just too much
"baggage" to support that at this point.

This is a minor variation of 75bb9d, which exposed some sort of internal V8 bug.
Ref #6358

This is 100% authored by Kitson Kelly. Github might change the author when landing
so I'm leaving this in:
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2020-06-18 09:06:48 -04:00
Chris Knight
78a311aa5f
docs: Update standard library and testing manual pages (#6323) 2020-06-18 06:13:56 -04:00
River
2a5af8b36b
fix: decode path properly on win32 (#6351) 2020-06-18 06:10:07 -04:00
crowlKats
ebf5c7b8cc
Fix failure message for deno upgrade (#6348) 2020-06-17 21:38:52 -04:00
Bartek Iwańczuk
097e42418c
chore: move fmt test to integration tests (#6340) 2020-06-17 21:50:30 +02:00
Bartek Iwańczuk
e60922981b
Revert "Deno.bundle supports targets < ES2017. (#6328)" (#6342)
This reverts commit 75bb9dbdfc.
2020-06-17 19:44:40 +02:00
Kitson Kelly
75bb9dbdfc
Deno.bundle supports targets < ES2017. (#6328)
This commit provides a "system_loader_es5.js" bundle loader which will be added
to the bundle when the target is < ES2017, which is the minimum target syntax
required for "system_loader.js".

Supports #5913 (via Deno.bundle()) with a couple caveats:

* Allowing "deno bundle" to take a different target is not supported, as we
specifically ignore "target" when passed in a TypeScript config file. This is
because deno bundle is really intended to generate bundles that work in Deno.
It is an unintentional side effect that some bundles are loadable in browsers.

* While a target of "es3" will be accepted, the module loader will still only be
compatible with ES5 or later. Realistically no one should be expecting bundles
generated by Deno to be used on IE8 and prior, and there is just too much
"baggage" to support that at this point.
2020-06-17 15:13:02 +02:00
Bartek Iwańczuk
e88d72f101
chore: remove glob dependency (#6317) 2020-06-16 17:29:43 -04:00
skdltmxn
b3c72d1e45
feat(std/hash): reimplement all hashes in WASM (#6292) 2020-06-16 17:12:50 -04:00
Bartek Iwańczuk
b8872cd303
fix(cache): apply redirection limit for cached files (#6308) 2020-06-15 23:46:48 +02:00
Ryan Dahl
c54dec8576
Fix DENO_DIR docs (#6271) 2020-06-15 18:29:39 +02:00
Peter Evers
fc850b11e5
unixpacket should also return byte length on send (#6291) 2020-06-15 12:20:45 -04:00
Bartek Iwańczuk
b1893e65f2
fix(compiler): JSX compilation and provide better error message (#6300) 2020-06-15 17:53:05 +02:00
Luca Casonato
0ffc99a61d
Move to allowlist and blocklist (#6282) 2020-06-13 13:09:39 -04:00
Kermit Xuan
77545219a6
fix: DatagramConn.send should return bytes sent (#6265) 2020-06-13 10:14:31 -04:00
Nayeem Rahman
1fff6f55c3
refactor: Don't destructure the Deno namespace (#6268) 2020-06-12 15:23:38 -04:00
Bartek Iwańczuk
7d41bacfba
v1.1.0 2020-06-12 18:43:09 +02:00
Nayeem Rahman
e613bfe47a
feat: Add TestDefinition::only (#5793) 2020-06-12 11:58:04 -04:00
Jaap Aarts
3eee961473
document "deno run -" (#6256) 2020-06-12 10:59:51 -04:00
Bartek Iwańczuk
07bf90779b
feat(lint): add --rules flag (#6264) 2020-06-12 16:42:12 +02:00
Ryan Dahl
e9424bf6b5
Revert "feat: add Deno.osName()" (#6261)
Deno.build.os provides the same functionality

This reverts commit 6ccf9037a6.
2020-06-12 09:53:53 -04:00
Casper Beyer
b34f468943
improve truncate tests (#6251) 2020-06-12 09:40:06 -04:00
Bartek Iwańczuk
c073f552d9
docs(lint): add entry in manual (#6258) 2020-06-12 15:31:04 +02:00
Ryan Dahl
d0970daacd
make std deno-lint clean (#6240)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-06-12 09:19:29 -04:00
Chris Knight
ca1c2ee822
doc: fix inspect example with correct InspectOptions (#6255) 2020-06-12 14:40:32 +02:00
Casper Beyer
9285221452
fix(cli/js): broken truncate permission tests (#6249)
The tests for testing that `Deno.truncateSync` and `Deno.truncate`
require write permissions seem to not call the functions they are
testing *at all* and are calling `Deno.mkdir` and `Deno.mkdirSync`
instead.

This commit replaces those calls with calls to `Deno.truncateSync`
and `Deno.truncate` respectively.
2020-06-12 14:25:07 +02:00
Bartek Iwańczuk
e7054d50f0
update: deno_lint to v0.1.10 (#6248)
* update: deno lint to v0.1.10

* Parallelize "deno lint" subcommand
2020-06-12 01:44:17 +02:00
Rubin Bhandari
6ccf9037a6
feat: add Deno.osName() (#5714) 2020-06-11 13:11:26 -04:00
River
818a801092
feat: URL support in Deno filesystem methods (#5990) 2020-06-11 12:36:20 -04:00
Casper Beyer
813210d433
fix: WebAssembly runtime error propagation (#6137)
Currently WebAssembly runtime errors don't propagate up to the user as
they use urls to denote where the error occurred which get caught by the source-map
pipeline which doesn't support the wasm scheme.
2020-06-11 11:03:27 -04:00
Jaap Aarts
5ee2ce1b1c
feat: allow reading the entry file from stdin (#6130) 2020-06-11 10:58:09 -04:00
John Gardner
ca5b5ba530
feat: Add Deno.mainModule (#6180) 2020-06-10 23:00:29 -04:00
Bartek Iwańczuk
e4e332abbb
feat(lint): use default globs, upgrade to v0.1.9 (#6222)
This commit:
* added default file globs so "deno lint" can be run
without arguments (just like "deno fmt")
* added test for globs in "deno lint"
* upgrade "deno_lint" crate to v0.1.9
2020-06-10 23:29:48 +02:00
Josh Byrnes
408edbb065
fix(URL): IPv6 hostname support (#5766) 2020-06-10 14:05:10 -04:00
Casper Beyer
be8bacaaa4
fix: Remove try-catch from Buffer.readFrom, readFromSync (#6161) 2020-06-10 11:54:54 -04:00
Ryan Dahl
54c3f8e27f
fix udp BorrowMutError (#6221) 2020-06-10 11:26:28 -04:00
Nayeem Rahman
8f050355ff
fix(cli/js/process): Always return a code in ProcessStatus (#5244) 2020-06-10 11:10:08 -04:00
Bartek Iwańczuk
4b7d3b060e
fix: several regressions in TS compiler (#6177)
This commit fixes several regressions in TS compiler:

* double compilation of same module during same process run

* compilation of JavaScript entry point with non-JS imports

* unexpected skip of emit during compilation

Additional checks were added to ensure "allowJs" setting is 
used in TS compiler if JavaScript has non-JS dependencies.
2020-06-10 16:02:41 +02:00
Bartek Iwańczuk
db70b77e4b
fix: handle @deno-types in export {} (#6202)
* fix: handle @deno-types in export {}

* lint

* fix tests

* fmt

* fix test
2020-06-10 14:19:41 +02:00
Bartek Iwańczuk
8366f36873
upgrade: deno_lint v0.1.8 (#6208) 2020-06-09 18:40:08 +02:00
Casper Beyer
1e0808d501
fix: Deno.readSync on stdin (#6126)
Currently sync operations on stdin are failing because tokio::Stdin
cannot be converted to a std::File.

This commit replaces tokio::stdin with a raw file descriptor 
wrapped in a std::fs::File which can be converted to a 
tokio::File and back again making the synchronous version 
of op_read actually work.
2020-06-09 18:29:12 +02:00
Tuan Le
878f306a39
feat(cli): Add Deno.env.delete() (#5859) 2020-06-09 14:58:30 +02:00
Nayeem Rahman
44251ce8ea
fix(cli/js/web/worker): Disable relative module specifiers (#5266) 2020-06-09 14:33:52 +02:00
uki00a
2b2d800b43
feat(doc): display all overloads in cli details view (#6186) 2020-06-09 14:12:47 +02:00
Nayeem Rahman
b3e189ee4f
fix(cli/js/process): Strengthen socket types based on pipes (#4836) 2020-06-09 13:18:18 +02:00
Jack Kelly
cb29f7f323
test: fixed initial [WILDCARD] not matching empty the on first line (#5420) 2020-06-08 19:24:27 +02:00
Peter Indiola
6236252c66
feat(cli/js/net): make rid on listener public (#5571) 2020-06-08 18:24:51 +02:00
Marcos Casagrande
d907133944
fix(cli/web/fetch): multipart/form-data request body support for binary files (#5886) 2020-06-08 18:08:26 +02:00
Faycel
4feccdd3b7
Adjusting the HTTPS_PROXY flag text (#6103) 2020-06-08 12:06:06 -04:00
Bartek Iwańczuk
0e9da7e731
feat: "deno lint" subcommand (#6125) 2020-06-08 14:06:20 +02:00
Akshat Agarwal
1e709387e4
Add "fork" method on DenoPermissions, PermissionState (#5693) 2020-06-06 16:56:21 +02:00
Filippo Rossi
78333f0ab3 Add diff for "deno fmt --check" (#5599) 2020-06-06 09:07:59 -04:00
Ryan Dahl
8a4533eb75 feat: deno eval -p (#5682) 2020-06-06 09:07:59 -04:00
Casper Beyer
ed5aedc6b4
Rename abbreviated assertions in std/testing (#6118) 2020-06-05 23:43:00 -04:00
Taisuke Fukuno
93175b7a79
added mjs files for default fmt (#6134) 2020-06-05 23:36:50 -04:00
Taisuke Fukuno
d2243b1125
deno test should run mjs files (#6122) 2020-06-05 17:01:44 -04:00
Bert Belder
18670c47e6
fix: 'deno upgrade' doesn't work on Windows 8.1/PowerShell 4.0 (#6132)
Fixes: #6109
2020-06-05 22:16:44 +02:00
Bert Belder
ee7727cd07
To find home dir, use only $USERPROFILE on Windows, $HOME on Posix (#6132)
$HOME is meaningless on Windows. It may be set by users or by third
party software, but it is non-standard and should not be relied upon.

Likewise, $USERPROFILE is meaningless on other platforms.
2020-06-05 22:15:05 +02:00
Ryan Dahl
78bfeebad1
Revert "fix: Use # to denote line number in stack traces" (#6119)
This reverts commit c4c6a8dae4

There is some controversy about this change because vscode doesn't interpret the fragments correctly. Needs more discussion before landing.
2020-06-05 11:37:40 -04:00
Andrew Mitchell
c4c6a8dae4
fix: Use # to denote line number in stack traces (#6114)
This makes the URLs in stack traces actual URLs to the files.
Before: https://deno.land/std/testing/asserts.ts:138:11
After: https://deno.land/std/testing/asserts.ts#138:11
2020-06-05 08:01:02 -04:00
Bert Belder
9a783ae4e6
ci: upgrade to Rust 1.44.0 (#6113) 2020-06-05 05:11:15 +02:00
Ryan Dahl
e3cc3db20f
Revert "feat: format deno bundle output (#5139)" (#6085)
This reverts commit 93cf3bd534.
2020-06-04 08:36:25 -04:00
uki00a
9bd5c08d5a
feat(doc): handle detail output for enum (#6078) 2020-06-03 21:40:50 +02:00
David Sherret
fcae2fec87
Upgrade to swc_ecma_parser 0.24.5 (#6077) 2020-06-03 21:36:55 +02:00
Chris Knight
1ebd330927
doc: complete unstable documentation and make consistent (#6074) 2020-06-03 13:46:09 -04:00
Ryan Dahl
515d19d901
v1.0.5 2020-06-03 12:52:01 -04:00
David Sherret
445e44199b
Update to dprint 0.19.1 and swc_ecma_parser 0.24.3 (#6068) 2020-06-03 17:24:25 +02:00
Marcos Casagrande
a1915a0d4f
fix(fetch): Support 101 status code (#6059) 2020-06-03 09:43:11 -04:00
Ryan Dahl
23dc9c13db
Fix REPL BorrowMutError panic (#6055) 2020-06-02 16:37:52 -04:00
Ryan Dahl
b7b6e0674f
Remove unused check-only feature (#6035) 2020-06-02 14:56:21 -04:00
Bartek Iwańczuk
9c59a4b18c
v1.0.4 2020-06-02 15:48:17 +02:00
Kitson Kelly
3fe6bc1b82
fix: Better use of @ts-expect-error (#6038) 2020-06-02 00:24:44 -04:00
Ryan Dahl
8b1b4766a1
Move create_main_worker to MainWorker::create (#6034) 2020-06-01 22:44:17 -04:00
Ali Hasani
30785ed592
fix(bundle): better size output (#5997) 2020-06-01 18:42:12 -04:00
Matt Dumler
a4567e0e01
fix(doc): remove JSDoc comment truncation (#6031) 2020-06-01 18:40:51 -04:00
Ryan Dahl
b693ca7f7f
upgrade: crates (#6032) 2020-06-01 16:25:10 -04:00
Bartek Iwańczuk
c813990806
fix: compile TS dependencies of JS files (#6000)
This commit fixes regression that caused TS dependencies
not being compiled.

Check was added that ensures TS compiler is run if 
any of dependencies in module graph is TS/TSX/JSX.
2020-06-01 21:01:51 +02:00
Valentin Anger
becbb56b19
feat(core): Ops can take several zero copy buffers (#4788) 2020-06-01 14:20:47 -04:00
精武陈真
f0ba814a79
fix jsDoc (#5992) 2020-06-01 09:53:43 -04:00
Marcos Casagrande
29db4104c4
fix(cli/web): Body.bodyUsed should use IsReadableStreamDisturbed 2020-06-01 14:37:46 +02:00
Marcos Casagrande
1d3dce9a68
fix(cli/js/web): formData parser for binary files (#6015) 2020-06-01 14:32:08 +02:00
Marcos Casagrande
edeeedf401
fix(cli/fetch): set null body for null-body status (#5980) 2020-05-31 19:21:14 -04:00
Marcos Casagrande
08552fc6b9
fix(fetch): network error on multiple redirects (#5985) 2020-05-31 16:13:53 -04:00
Marcos Casagrande
ecb94c06e9
fix Headers.name and FormData.name (#5994) 2020-05-31 16:07:24 -04:00
Bartek Iwańczuk
02d46bae9f
fix: media type for .cjs and application/node (#6005) 2020-05-31 21:08:26 +02:00
uki00a
464f5bf769
chore(cli/tests/unit/remove_test): remove duplicate codes between sync and async cases (#6004) 2020-05-31 13:19:56 -04:00
uki00a
64bd2768f7
fix(#4850): Deno.remove() fails to remove unix socket (#5967) 2020-05-30 14:48:26 -04:00
Bartek Iwańczuk
550556e948
fix: ES private fields parsing in SWC (#5964) 2020-05-30 17:32:48 +02:00
Chris Knight
8b037364ac
doc: add/update jsdoc for global functions (#5963) 2020-05-30 11:19:16 -04:00
Ryan Dahl
dad551a3a7
upgrade: Rust crates (#5959) 2020-05-30 11:35:44 +02:00
Marcos Casagrande
a82f24e9a8
test to check that resource handle is closed after stream is cancelled (#5956) 2020-05-30 01:02:41 -04:00
Ryan Dahl
d4b05dd89e
refactor: Split isolate and state using safe get_slot() (#5929) 2020-05-29 17:41:39 -04:00
Bartek Iwańczuk
106b001738
v1.0.3 2020-05-29 18:48:48 +02:00
Nayeem Rahman
8e39275429
fix(cli/permissions): Fix CWD and exec path leaks (#5642) 2020-05-29 17:27:43 +02:00
Bartek Iwańczuk
ad6d2a7734
refactor: TS compiler and module graph (#5817)
This PR addresses many problems with module graph loading
introduced in #5029, as well as many long standing issues.

"ModuleGraphLoader" has been wired to "ModuleLoader" implemented
on "State" - that means that dependency analysis and fetching is done
before spinning up TS compiler worker.

Basic dependency tracking for TS compilation has been implemented.

Errors caused by import statements are now annotated with import
location.

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-05-29 16:32:15 +02:00
Nayeem Rahman
49c7077401
fix(cli/js/error_stack): Expose Error.captureStackTrace (#5254) 2020-05-29 14:02:36 +02:00
Akshat Agarwal
ce246d8d85
feat(cli): deserialize Permissions from JSON (#5779) 2020-05-29 13:00:47 +02:00
Luca Casonato
02a6720527
Improved typechecking error for unstable props (#5503) 2020-05-29 12:45:20 +02:00
Kitson Kelly
2668637e9b
fix: REPL evaluates in strict mode (#5565)
Since everything that Deno loads is treated as an ES Module, 
it means that all code is treated as "use strict" except for 
when using the REPL. This PR changes that so code in the 
REPL is also always evaluated with "use strict". There are 
also a couple other places where we load code as scripts 
which should also use "use strict" just in case.
2020-05-29 12:24:06 +02:00
Adam Odziemkowski
958f21e7ab
fix(cli): write lock file before running any code (#5794) 2020-05-29 02:43:31 -04:00
Peter Evers
fe7d6824c9
fix DenoBlob name (#5879) 2020-05-29 02:27:57 -04:00
uki00a
55311c33c4
chore(integration_tests): stop collecting unnecessary output in permissions tests (#5926) 2020-05-28 19:40:33 -04:00
David Sherret
dc6c07e3ed
fix(cli): Handle formatting UTF-8 w/ BOM files (#5881) 2020-05-28 13:35:24 -04:00
Speykious
6d9b06619d
improve indentation when displaying objects with console.log (#5909) 2020-05-28 09:04:43 -04:00
Marcos Casagrande
c9bbb200d6
formData: set default filename for Blob to <blob> (#5907) 2020-05-28 09:02:00 -04:00
Kevin (Kun) "Kassimo" Qian
3cbcdd4250
console: Hide values for console.table if display not necessary (#5914) 2020-05-28 08:30:32 -04:00
Matt Dumler
f6e58b076c
fix(doc): handle comments at the top of the file (#5891) 2020-05-27 23:38:36 +02:00
Marcos Casagrande
f8c6500eef
test(clie/web/fetch): Re-enable tests (#5904) 2020-05-27 16:37:19 -04:00
Bartek Iwańczuk
7d764a2c27
upgrade: dprint to 0.19.0 (#5899) 2020-05-27 11:19:31 -04:00
Kitson Kelly
228f9c207f
Use ts-expect-error instead of ts-ignore. (#5869) 2020-05-26 10:02:16 -04:00
Bartek Iwańczuk
f462f7fe54
fix: parsing of JSX and TSX in SWC (#5870) 2020-05-26 15:41:00 +02:00
Marcos Casagrande
4e92ef7dc9
Add more tests for fetch response body (#5852) 2020-05-25 16:20:09 -04:00
Marcos Casagrande
08f74e1f6a
fix(cli/web/fetch): Make Response constructor standard (#5787) 2020-05-25 12:55:16 -04:00
Marcos Casagrande
1c4a9665e2
fix: Allow ArrayBuffer as Fetch request body (#5831) 2020-05-25 09:26:36 -04:00
Marcos Casagrande
c9f0e34e29
Improve bufferFromStream (#5826) 2020-05-25 09:14:01 -04:00
Marcos Casagrande
20bf04dc7e
Move getHeaderValueParams & hasHeaderValueOf to util.ts (#5824) 2020-05-25 09:12:09 -04:00
Bert Belder
131f2a5f0c
fix: BorrowMutError when evaluating expression in inspector console (#5822)
Note that this does not fix the 'Uncaught ReferenceError' issue that
happens when 'eager evaluation' is enabled in the inspector.

Fixes: #5807
2020-05-25 04:26:33 +02:00
Bert Belder
ee0b5bb89e
test: add utility function for assigning unique port to inspector (#5822) 2020-05-25 02:41:59 +02:00
Bartek Iwańczuk
e934df5f7d
fix: create HTTP cache lazily (#5795) 2020-05-24 19:20:40 +02:00
Andrew Mitchell
4ca0d6e2d3
Re-enable several fetch tests (#5803) 2020-05-24 12:04:57 -04:00
Valentin Anger
b7f0b073bb
Add unstable checks for unix transport (#5818)
Also remove the unix example from the stable documentation
to stay in line with the `Deno.listen` one
2020-05-24 09:43:40 -04:00
Bartek Iwańczuk
c3c16f025c
fix: TSX analysis in module graph loader (#5785) 2020-05-23 19:04:29 +02:00
guzhongren
94f1de5f80
Fix example (#5775) 2020-05-23 10:16:57 -04:00
Luca Casonato
6feca0ef8b
Fix Deno.dir and Diagnostics being present at stable runtime (#5750) 2020-05-23 09:37:12 -04:00
Marcos Casagrande
28b651c2e2
Simplify isFiniteNonNegativeNumber (#5686) 2020-05-22 22:09:35 -04:00
Ergenekon Yiğit
4fa69e890e
fix: atob should throw dom exception (#5730) 2020-05-22 21:52:50 -04:00
Bartek Iwańczuk
526c9196e2
v1.0.2 2020-05-22 20:00:28 +02:00
Bartek Iwańczuk
960f9ccb2e
fix: SWC lexer settings and silent errors (#5752)
This commit changes how error occurring in SWC are handled.
Changed lexer settings to properly handle TS decorators.
Changed output of SWC error to annotate with position in file.
2020-05-22 19:23:35 +02:00
Bartek Iwańczuk
e191c70989
fix: ts type imports (#5733) 2020-05-22 19:05:18 +02:00
Chris Knight
4b06e35765
doc: clarify and warn on Deno.read/write behaviour (#5743) 2020-05-22 12:56:12 -04:00
Bartek Iwańczuk
f9e45114b9
fix: redirects handling in module analysis (#5726)
This commit fixes a bug introduced in #5029 that caused bad 
handling of redirects during module analysis. 

Also ensured that duplicate modules are not downloaded.
2020-05-22 16:01:00 +02:00
David Sherret
ee71099492
fix(fmt): Do not panic on new expr with no parens. (#5734)
Closes #5567
2020-05-21 20:43:32 -04:00
Bartek Iwańczuk
491feb859f
fix: --inspect flag working like --inspect-brk (#5697) 2020-05-21 20:34:25 +02:00
Bhumij Gupta
88e8c32652
docd: Replace obsolete Deno.homeDir() with Deno.dir('home') (#5708) 2020-05-21 14:06:42 +02:00
Colin Harrington
aea5b12bae
ci: Errors in benchmarks should fail CI (#5422) 2020-05-21 13:08:43 +02:00
Bartek Iwańczuk
5f9c1c7da6
fix: disallow http imports for modules loaded over https (#5680) 2020-05-21 13:06:12 +02:00
Maple Miao
9fdc6dc435
docs: fix test glob pattern (#5661) 2020-05-21 01:02:32 -04:00
Marcos Casagrande
47b089ffa8
fix: streams hwm validation (#5681) 2020-05-20 20:18:43 -04:00
Ryan Dahl
30702e2678
move js unit tests to cli/tests (#5678) 2020-05-20 17:52:51 -04:00
Ryan Dahl
49dda23f6b
v1.0.1 2020-05-20 12:40:26 -04:00
David Sherret
91d576aa5a
Update dprint 0.18.4 (#5671)
Fixes trailing comma issue
2020-05-20 10:30:33 -04:00
Bartek Iwańczuk
8799855fdc
refactor: reorganize TS compiler (#5603) 2020-05-20 16:25:40 +02:00
Ryan Dahl
0fb5f23466
fix(doc): crash on formatting type predicate (#5651) 2020-05-19 18:55:06 -04:00
Speykious
9752b853dd
Provide better ANSI colorized output when inspecting objects (#5404) 2020-05-19 14:19:26 -04:00
uki00a
cdc9323ccc
fix: REPL does not exit properly when close() is called (#5451) 2020-05-19 13:33:11 -04:00
buckle2000
1be7ec47ac
Mark Deno.pid and Deno.noColor as const (#5593) 2020-05-18 21:51:54 -04:00
Ali Hasani
6072755ead
Implement Deno.symlink() for windows (#5533) 2020-05-19 00:46:02 +02:00
Nayeem Rahman
93c2164673
Fix URL encoding (#5557) 2020-05-18 09:47:45 -04:00
Ali Hasani
c3ec16535f
Make Deno.remove() work with directory symlinks on windows (#5488) 2020-05-18 14:50:44 +02:00
Ryan Dahl
2a038eafcd
Revert "Fix definition of URL constructor (#5521)" (#5564)
This reverts commit 63bc468365.
2020-05-18 08:46:56 -04:00
Bartek Iwańczuk
f6caf4883d
fix: disable test using 019_media_types (#5589)
This commit disabled flaky test in cli/module_graph.rs.

The test uses 019_media_types.ts which was known to be flaky
for some time. Test should be reenabled once test HTTP server
is rewritten to Rust.
2020-05-18 14:00:08 +02:00
Bartek Iwańczuk
9d63772fe5
refactor: rewrite TS dependency analysis in Rust (#5029)
This commit completely overhauls how module analysis is 
performed in TS compiler by moving the logic to Rust.

In the current setup module analysis is performed using 
"ts.preProcessFile" API in a special TS compiler worker 
running on a separate thread.

"ts.preProcessFile" allowed us to build a lot of functionality
in CLI including X-TypeScript-Types header support 
and @deno-types directive support. Unfortunately at the 
same time complexity of the ops required to perform 
supporting tasks exploded and caused some hidden 
permission escapes.

This PR introduces "ModuleGraphLoader" which can parse
source and load recursively all dependent source files; as 
well as declaration files. All dependencies used in TS 
compiler and now fetched and collected upfront in Rust 
before spinning up TS compiler.

To achieve feature parity with existing APIs this commit 
includes a lot of changes:

* add "ModuleGraphLoader"
  - can fetch local and remote sources
  - parses source code using SWC and extracts imports, exports, file references, special 
     headers
  - this struct inherited all of the hidden complexity and cruft from TS version and requires 
     several follow up PRs
* rewrite cli/tsc.rs to perform module analysis upfront and send all required source code to 
  TS worker in one message
* remove op_resolve_modules and op_fetch_source_files from cli/ops/compiler.rs
* run TS worker on the same thread
2020-05-18 12:59:29 +02:00
Bert Belder
36fde75d77
Miscellaneous documentation and spelling improvements (#5527)
* Extended/updated documentation on code editor setup and plugins.
* Moved documentation to the right file.
* Fixed spelling errors in documentation and code.
* Updated broken links.

Co-authored-by: 迷渡 <justjavac@gmail.com>
Co-authored-by: AlfieriChou <alfierichou@gmail.com>
Co-authored-by: Anil Seervi <anil13112000@gmail.com
Co-authored-by: Bert Belder <bertbelder@gmail.com>
Co-authored-by: Fernando Basso <fernandobasso.br@gmail.com>
Co-authored-by: József Sallai <jozsef@sallai.me>
Co-authored-by: S4ltyGo4t <mario.weidner@gmx.de>
Co-authored-by: Tommy May <tommymay37@gmail.com>
Co-authored-by: Turbinya <wownucleos@gmail.com>
Co-authored-by: ᴜɴвʏтᴇ <i@shangyes.net>
2020-05-17 19:24:39 +02:00
Ali Hasani
eddb916883
Implement Deno.kill for windows (#5347) 2020-05-17 19:11:24 +02:00
David Sherret
a054250a2c
Update to dprint 0.18.3 and the latest version of swc (#5509) 2020-05-17 18:56:22 +02:00
Bartek Iwańczuk
e16eb9e108
chore: capture stderr in integration tests (#5549)
This commit removes "check_stderr" setting from itest! macro used
to generate integration tests. Without this setting on tests discarded
output of stderr making it very hard to debug the problem in test.

Numerous tests were changed by adding "--quiet" flag to not display
"Compile"/"Download" prompts.
2020-05-17 17:42:39 +02:00
Masahiro Miyashiro (3846masa)
63bc468365
Fix definition of URL constructor (#5521) 2020-05-17 11:37:16 -04:00
Ali Hasani
6ffb8ee2c3
docs: update cli/js/tests README (#5531) 2020-05-17 12:14:37 +02:00
Yiyu Lin
c4fe58d8df
Return error if more than one listener calls WorkerHandle::get_event() (#5461) 2020-05-17 06:50:38 +02:00
Yiyu Lin
f12dffca9f
tsc: use serde to (de)serialize CompiledFileMetadata (#5481)
Co-authored-by: Bert Belder <bertbelder@gmail.com>
2020-05-16 21:47:26 +02:00
Siddharth Parmar
bfd4baf2d3
Fix formatting of example code in typescript declaration files (#5475) 2020-05-16 21:23:48 +02:00
Yiyu Lin
0b9942da84
fix some unwrap() in Rust (#5485) 2020-05-16 09:41:32 -04:00
Bert Belder
76a6a1ff46
Fix a bunch of spelling errors (#5314) 2020-05-16 00:36:49 +02:00
Yiyu Lin
871a0c9c0e
fix some clippy warning (#5462) 2020-05-15 15:26:16 -04:00
Bartek Iwańczuk
89fe81168e
fix: panic if $DENO_DIR is a relative path (#5375)
This commit fixes panic occurring if $DENO_DIR is set to a relative
path, eg. "DENO_DIR=denodir deno run main.ts".

Before creating DenoDir instance given path is checked and if necessary
resolved against current working directory.

Additional sanity checks were put in place to ensure all caches
receive absolute path for the location.
2020-05-15 16:32:52 +02:00
uki00a
c5a54e44bc
chore: port deno_dir_test to Rust (#5408) 2020-05-15 10:22:28 -04:00
Tomasz Gałkowski
8440d765d5
fix: setTimeout and friends have too strict types (#5412) 2020-05-15 09:51:49 -04:00
Chris Knight
8c45d3a06d
doc: add stream api (#5418) 2020-05-15 09:35:50 -04:00
Valentin Anger
5b76f7a838
Remove debug prints introduced in e18aaf49c (#5356) 2020-05-14 14:10:54 -04:00
Kevin (Kun) "Kassimo" Qian
7de86ab605
cli: don't panic on Deno.close invalid argument (#5320) 2020-05-14 06:59:56 -04:00
Dante Calderón
c3a205bae8
Fix typos across the repo (#5295)
Corrections made:
* cli/js/tests/README.md:44:7: corrected "discoveres" to "discovers"
* cli/js/tests/chown_test.ts:111:37: corrected "priviledge" to "privilege"
* cli/worker.rs:231:56: corrected "decendants" to "descendants"
* deno_typescript/lib.rs:136:50: corrected "emmited" to "emitted"
* core/es_isolate.rs:492:67: corrected "registerd" to "registered"
* core/isolate.rs:103:28: corrected "initalize" to "initialize"
* docs/runtime.md:29:14: corrected "ect" to "etc"
* docs/tools/debugger.md:122:16: corrected "implementes" to "implements"
* std/encoding/_yaml/dumper/dumper_state.ts:57:63: corrected "everwhere" to "everywhere"
* std/encoding/csv.ts:37:43: corrected "referal" to "referral"
* std/fmt/sprintf.ts:209:20: corrected "unusuable" to "unusable"
* std/fmt/README.md:21:40: corrected "Alternativly" to "Alternatively"
* std/fmt/README.md:35:68: corrected "seperated" to "separated"
* std/fmt/README.md:179:59: corrected "provded" to "provided"
* std/mime/multipart.ts:581:46: corrected "writen" to "written"
* std/path/_globrex.ts:19:52: corrected "equivelant" to "equivalent"
* std/node/events_test.ts:447:9: corrected "asyncronous" to "asynchronous"
* std/node/events_test.ts:475:9: corrected "asyncronous" to "asynchronous"
* std/node/events_test.ts:500:29: corrected "asyncronous" to "asynchronous"
* std/node/events_test.ts:530:40: corrected "asyncronous" to "asynchronous"
* std/node/events_test.ts:555:9: corrected "asyncronous" to "asynchronous"
* tools/deno_tcp_proxy.ts:1:42: corrected "perfromance" to "performance"
* std/node/module.ts:1003:18: corrected "existend" to "existed"
2020-05-14 06:38:42 +02:00
Bartek Iwańczuk
55d2c6bd10
v1.0.0 2020-05-13 18:07:15 -04:00
Pavan Kumar
9c01403865
default to 0.0.0.0 for Deno.listen (#5203) 2020-05-13 09:18:41 -04:00
Kitson Kelly
3d7552af2e
Update to TypeScript 3.9 (#4510) 2020-05-13 08:03:04 -04:00
Bert Belder
e34a3b61f4
Make --inspect-brk pause on the first line of _user_ code (#5250) 2020-05-13 00:12:46 +02:00
A.E Clarence
e90c95b465
fix example of readTextFile (#5247) 2020-05-12 13:38:44 -04:00
Bartek Iwańczuk
053c568c8c
fix: source maps in inspector for local files (#5245)
This commit changes handling of source maps by setting proper
file URLs for "file" and "sources" fields in the source map.
2020-05-12 17:44:25 +02:00
Bartek Iwańczuk
35e8bc8de6
v1.0.0-rc3 2020-05-12 08:33:18 -04:00
Bartek Iwańczuk
d062ffc1ba
fix: source maps in inspector (#5223)
This commit fixes problems with source maps in Chrome Devtools
by substituting source map URL generated by TS compiler with
actual file URL pointing to DENO_DIR.

Dummy value of "source_map_url" has been removed from
"ScriptOrigin".

Also fixes lock file which used compiled source code to generate
lock hash; it now uses source code of the file that is
being compiled.
2020-05-11 23:48:36 +02:00
Ryan Dahl
73d8fa74c6
BREAKING: There is no public Rust API for the CLI (#5226) 2020-05-11 17:33:36 -04:00
Bert Belder
3cccadcf0f
Change plugin interface to prevent segfaults when unloading plugin (#5210)
Fixes: #3473
Closes: #5193
2020-05-11 22:39:13 +02:00
Ryan Dahl
fb7d7f40ed
Merge std_tests.rs into integration_tests.rs.rs (#5228)
* Remove usage of url_to_filename from integration_tests
* Make test ports not conflict with each other
2020-05-11 14:49:19 -04:00
Kitson Kelly
d16c7394cb
fix: Expose ErrorEvent globally (#5222) 2020-05-11 14:28:13 +02:00
Bartek Iwańczuk
32aeec9630
refactor: check permissions in SourceFileFetcher (#5011)
This PR hot-fixes permission escapes in dynamic imports, workers
and runtime compiler APIs.

"permissions" parameter was added to public APIs of SourceFileFetcher
and appropriate permission checks are performed during loading of
local and remote files.
2020-05-11 13:13:27 +02:00
Bartek Iwańczuk
0d148c6e80
fix: remove default --allow-read perm for deno test (#5208) 2020-05-10 23:24:36 +02:00
David Sherret
e9318aa2c0
Update to dprint 0.17.2 (#5195) 2020-05-10 08:49:00 -04:00
Bartek Iwańczuk
d8f5b37218
1.0.0-rc2 2020-05-09 15:37:22 -04:00
Bartek Iwańczuk
1fddcc3721
refactor(cli): unify display of errors from Rust and JS (#5183) 2020-05-09 21:09:46 +02:00
Kitson Kelly
670d01d012
fix: Allow multiple Set-Cookie headers (#5100) 2020-05-09 19:20:18 +02:00
Nayeem Rahman
7a635eda5e
fix(cli/installer): Fix concurrent env handling in tests (#5182) 2020-05-09 19:14:56 +02:00
Ryan Dahl
b8364a2636
BREAKING: make Deno.hostname unstable (#5108) 2020-05-09 12:44:35 -04:00
Ryan Dahl
eb505f8afc
Add support for X-Deno-Warning header (#5161) 2020-05-09 12:43:24 -04:00
Nayeem Rahman
f184332c09
BREAKING(std): reorganization (#5087)
* Prepend underscores to private modules
* Remove collectUint8Arrays() It would be a misuse of Deno.iter()'s result.
* Move std/_util/async.ts to std/async
* Move std/util/sha*.ts to std/hash
2020-05-09 08:34:47 -04:00
crowlKats
abbf0339cd
feat(upgrade): allow specifying a version (#5156) 2020-05-09 06:31:15 -04:00
Michał Zdunek
9790399bce
add option to lint and format only staged files (#5172) 2020-05-09 06:22:27 -04:00
Ryan Dahl
4e5e6da348
Add hint on how to exit REPL (#5143)
Removes exit and help commands
2020-05-08 18:58:51 -04:00
Bartek Iwańczuk
f9f10229a4
refactor: Remove cli::compilers module (#5138)
This PR removes "cli/compilers/" directory.

"cli/compilers/ts.rs" has been renamed to "cli/tsc.rs"
2020-05-08 16:18:00 +02:00
Oliver Lenehan
a08a4abac1
feat(workers): "crypto" global accessible in Worker scope (#5121) 2020-05-08 14:30:53 +02:00
Chris Knight
5fea4e826c
fix: correct type error text (#5150) 2020-05-08 14:28:46 +02:00
Bartek Iwańczuk
aca21dad1b
BREAKING: make Worker.deno unstable (#5128)
This commit makes "Worker.deno" option unstable.

Added new manual entry "docs/runtime/workers.md".

Removed stale workers tests.
2020-05-07 21:15:59 +02:00
Bartek Iwańczuk
2b66b8a03e
BREAKING: Remove support for .wasm imports (#5135)
Importing .wasm files is non-standardized therefore deciding to
support current functionality past 1.0 release is risky.

Besides that .wasm import posed many challenges in our codebase
due to complex interactions with TS compiler which spawned
thread for each encountered .wasm import.

This commit removes:
- cli/compilers/wasm.rs
- cli/compilers/wasm_wrap.js
- two integration tests related to .wasm imports
2020-05-07 20:43:27 +02:00
Yoshiya Hinosawa
93cf3bd534
feat: format deno bundle output (#5139) 2020-05-07 14:39:00 -04:00
Ryan Dahl
9a8d948420
Remove REPL/Windows hack (#5136) 2020-05-07 12:01:27 -04:00
Bartek Iwańczuk
53265fb6db
feat(bundle): add --config flag (#5130) 2020-05-07 17:02:03 +02:00
Bartek Iwańczuk
0ba90c8c11
fix(imports): fix panic on unsupported scheme (#5131) 2020-05-07 15:57:10 +02:00
Yoshiya Hinosawa
dabe88f854
fix(deno_dir): better error message (#5120)
Add better error messages when a cache subdirectory in 
`DENO_DIR` cannot be created.
2020-05-07 14:32:57 +02:00
zjopy
761b7efb3b
fix(docs): add missing "deno run" (#5126) 2020-05-07 13:48:48 +02:00
Bert Belder
7e00b2471d
Upgrade to rusty_v8 0.4.2 / V8 8.4.300 (#5113) 2020-05-06 22:35:24 +02:00
Ryan Dahl
6666f1d36a
remove target_test.py (#5112) 2020-05-06 16:34:48 -04:00
Ryan Dahl
221221cc97
BREAKING: execPath should require allow-read (#5109) 2020-05-06 15:51:33 -04:00
Nikolai Vavilov
76c77bb32c
Check destination length in encodeInto (#5078) 2020-05-06 13:10:15 -04:00
Bartek Iwańczuk
91369841ef
refactor(ts): make processImports logic more verbose (#5089) 2020-05-06 16:59:43 +02:00
Ryan Dahl
2b15e53d5a
Upgrade crates (#5104) 2020-05-06 10:10:51 -04:00
Bartek Iwańczuk
e18aaf49cf
feat: deno doc handles default exports (#4873) 2020-05-06 14:48:48 +02:00
Bert Belder
e513751ee9
Clean up 'inspector_break_on_first_line' test and fix its flakiness (#5098) 2020-05-06 04:32:14 +02:00
Bartek Iwańczuk
2ecdbb62ae
refactor: merge TS compiler into single file (#5091) 2020-05-06 00:19:18 +02:00
Bartek Iwańczuk
9cd7d59840
fix(cli): fix paths in internal stack traces (#5093)
This commit updates "deno_typescript" crate to properly map
bundle entrypoint file to internal specifier.

All import specifiers were remapped from "file:///a/b/c.ts" to
"$deno$/a/b/c.ts", but that was not the case for entrypoint file
"main.ts" and "compiler.ts".

Because of that internal stack traces were inconsistent; showing
"file:///some/random/path/on/ci/machine.ts" URL in frames that
originate from "main.ts" or "compiler.ts" and "$deno$/file.ts"
for all other imports.
2020-05-05 23:13:04 +02:00
Ryan Dahl
5875bb9c0d
Simplify ProcessStdio (#5092) 2020-05-05 16:54:25 -04:00
Bartek Iwańczuk
cf5a39a361
refactor(ts): remove op_cache (#5071)
This PR removes op_cache and refactors how Deno interacts with TS compiler.

Ultimate goal is to completely sandbox TS compiler worker; it should operate on
simple request -> response basis. With this commit TS compiler no longer
caches compiled sources as they are generated but rather collects all sources
and sends them back to Rust when compilation is done.

Additionally "Diagnostic" and its children got refactored to use "Deserialize" trait
instead of manually implementing JSON deserialization.
2020-05-05 18:23:15 +02:00
Bert Belder
e574437922
Fix inspector hanging when task budget is exceeded (#5083)
The issue is solved by proxying websocket messages over a pair of
`futures::mpsc::unbounded` channels. As these are are implemented in
the 'futures' crate, they can't participate in Tokio's cooperative
task yielding.
2020-05-05 16:12:45 +02:00
Ryan Dahl
5f67a202ff
v1.0.0-rc1 2020-05-04 15:46:39 -04:00
David Sherret
60f2d57fb7
feat(fmt): Add deno-fmt-ignore and deno-fmt-ignore-file comment support (#5075) 2020-05-04 15:17:15 -04:00
Nayeem Rahman
8c509bd885
feat(URL): Support drive letters for file URLs on Windows (#5074)
refactor: Parse URLs more sequentially. This makes it easier to change matching behaviour depending on the protocol.
fix: Fail when a host isn't given for certain protocols.
fix: Convert back-slashes info forward-slashes.
2020-05-04 14:32:54 -04:00
Ryan Dahl
6c02b061ce
stabilize Deno.cwd and require --allow-read (#5068) 2020-05-04 14:23:06 -04:00
Ryan Dahl
191c59a591
Rename DenoPermissions, add abs path asserts (#5076) 2020-05-04 14:10:59 -04:00
Ryan Dahl
38ecabf205
Simplify ts-compiler's normalizeString (#5072) 2020-05-04 12:22:42 -04:00
Ryan Dahl
92c0591fcb
simplify unit tests: compiler_api, workers (#5073) 2020-05-04 10:40:18 -04:00
Daniel Lenksjö
1500547afa
fix: URL constructor throws confusing error on invalid scheme (#5057) 2020-05-04 10:06:47 -04:00
Ryan Dahl
821a4ae5fd
Make it so ts compiler doesn't call cwd op (#5070)
Removes duplicate implementation of the module resolution algorithm
2020-05-04 09:39:40 -04:00
木杉
58d0c4f9d6
fix(console): formatting misalignment on console.table (#5046) 2020-05-04 13:36:26 +02:00
Divya
36ad4e3b77
fix(install): Propagate --unstable flag (#5061) 2020-05-04 13:35:00 +02:00
Bartek Iwańczuk
a913b7a1ba
BREAKING: remove CLI 'deno script.ts' hack (#5026)
This PR removes the hack in CLI that allows to run scripts with shorthand: deno script.ts.

Removing this functionality because it hacks around short-comings of clap our CLI parser. We agree that this shorthand syntax is desirable, but it needs to be rethinked and reimplemented. For 1.0 we should go with conservative approach that is correct.
2020-05-04 13:03:30 +02:00
Kitson Kelly
7e32269f3f
Add TransformStream and TransformStreamController (#5042) 2020-05-03 15:10:52 -04:00
Nayeem Rahman
0f3e6e2eea
fix(cli/fmt_errors): Respect NO_COLOR for stack frames (#5051) 2020-05-02 23:55:16 -04:00
Ryan Dahl
bbbf9f299c
Deno.chdir should require allow-read not allow-write (#5033) 2020-05-02 18:33:43 -04:00
Bartek Iwańczuk
2872b362ff
BREAKING: disallow static import of local modules from remote modules (#5050)
This commit changes module loading logic to disallow statically import
local module (file:// scheme) from remote modules (http://, https://
schemes).
2020-05-02 15:51:08 +02:00
Bartek Iwańczuk
de2c042482
BREAKING: remove support for JSON imports (#5037)
This commit removes support for importing JSON files as modules.

This change is dictated by security; browsers rolled back on this
support as well.
2020-05-02 00:32:05 +02:00
Nayeem Rahman
96fd0f4692
BREAKING: feat(cli/installer): Support guessing the executable name (#5036) 2020-05-01 15:33:11 -04:00
Bartek Iwańczuk
6661e7e287
BREAKING: remove window.location and self.location (#5034)
This commit removes "location" global available on "window",
"globalThis" and "self".
2020-05-01 20:15:28 +02:00
Ryan Dahl
5d3c49082f
Correct copyright in cli/js/web/decode_utf8.ts (#5035) 2020-05-01 13:29:00 -04:00
Fenzland
25b765c123
fix misaligned error reporting on tab char (#5032) 2020-05-01 13:03:54 -04:00
Marcos Casagrande
4297b865f9
internal: reorder Buffer's copyBytes arguments (#5021) 2020-04-30 15:46:44 -04:00
David Sherret
3e72d63205
fix(fmt): Format abstract async as abstract async (#5020) 2020-04-30 21:05:30 +02:00
Bartek Iwańczuk
f79cb08e0b
feat: add SWC dependency analyzer (#5015)
This commit adds "analyze_dependencies" function that uses SWC
(by the means of AstParser) to perform analysis of static and dynamic
imports.
2020-04-30 20:18:50 +02:00
Luca Casonato
80e2211141
Unstable methods should not appear in runtime or d.ts (#4957)
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2020-04-30 11:23:40 -04:00
Bartek Iwańczuk
4993a6504b
fix(doc): better repr for object literal types (#4998) 2020-04-30 16:40:51 +02:00
Kitson Kelly
81c75332fb
feat: Add WritableStreams (and enable ReadableStreams piping) (#4980) 2020-04-30 10:40:10 -04:00
Bartek Iwańczuk
46bfcbbaa8
refactor(core): add "prepare_load" hook to ModuleLoader trait (#4866)
This PR adds prepare_load hook method to ModuleLoader trait. It allows implementors to perform preparation work before starting actual module loading into isolate. It's meant to be used in CLI; where "transpilation" step will be explicitly performed during prepare_load instead of doing it adhoc for each module if needed.
2020-04-30 14:37:06 +02:00
Bartek Iwańczuk
f92bb9cf4d
v0.42.0 2020-04-29 17:04:05 -04:00
Ryan Dahl
bc792c0267
make camel case readDir, readLink, realPath (#4995) 2020-04-29 16:39:37 -04:00
Bartek Iwańczuk
d308e8d0c0
BREAKING: remove custom implementation of Deno.Buffer.toString() (#4992)
Keep in mind Buffer.toString() still exists, but returns [object Object]. 

Reason for removal of Buffer.toString() was that it implicitly used 
TextDecoder with fixed "utf-8" encoding and no way to customize 
the encoding.
2020-04-29 22:38:10 +02:00
Nayeem Rahman
b51c863550
feat(std/path): Add fromFileUrl() (#4993)
Fix: URL constructor accepts a URL object which is not a base
2020-04-29 16:20:55 -04:00
Bert Belder
3e6ea62841
BREAKING: Include limited metadata in 'DirEntry' objects (#4941)
This change is to prevent needed a separate stat syscall for each file
when using readdir.

For consistency, this PR also modifies std's `WalkEntry` interface to
extend `DirEntry` with an additional `path` field.
2020-04-29 16:00:31 -04:00
Valentin Anger
721a4ad59d
BREAKING: Map-like interface for Deno.env (#4942) 2020-04-29 14:48:19 -04:00
Brayden
2337fca277
Make Deno.isatty stable (#4937) 2020-04-29 12:43:34 +02:00
Marcos Casagrande
0703431ec2
fix: bug in Deno.copy (#4977) 2020-04-28 21:30:48 -04:00
Bartek Iwańczuk
640f6878f6
refactor: Deno.listener closes when breaking out of async iterator (#4976) 2020-04-29 01:08:02 +02:00
Bartek Iwańczuk
1b6181e434
refactor: factor out datagram from Deno.listen(), make it unstable (#4968)
This commit changes Deno.listen() API by factoring out datagram listeners to Deno.listenDatagram(). New Deno.listenDatagram() is unstable.
2020-04-28 21:46:39 +02:00
Ryan Dahl
ea28a088a4
Remove Conn.closeRead (#4970) 2020-04-28 15:17:55 -04:00
David Sherret
f899d76667
Fix stdin not formatting JSX (#4971) 2020-04-28 15:17:40 -04:00
Bartek Iwańczuk
6ee00e4da3
refactor: change InspectOptions, make Deno.inspect stable (#4967) 2020-04-28 20:11:50 +02:00
Nayeem Rahman
678313b176
BREAKING: Remove Deno.EOF, use null instead (#4953) 2020-04-28 12:40:43 -04:00
Ali Hasani
47c2f034e9
BREAKING: address renamed to path in UnixAddr UnixConnectOptions UnixListenOptions (#4959) 2020-04-28 12:37:59 -04:00
Ryan Dahl
e0ca60e770
BREAKING: Use LLVM target triple for Deno.build (#4948)
Deno.build.os values have changed to correspond to standard LLVM target triples
"win" -> "windows"
"mac" -> "darwin"
2020-04-28 12:35:23 -04:00
Bartek Iwańczuk
f7ab19b1b7
mark Deno.startTls as unstable (#4965) 2020-04-28 18:01:13 +02:00
Nayeem Rahman
76ee6fb335
refactor(cli/js/permissions): Split read and write permission descriptors (#4774) 2020-04-28 16:43:58 +02:00
Marcos Casagrande
927a771fa4
url: Make zero a valid port (#4963) 2020-04-28 10:40:17 -04:00
Bartek Iwańczuk
2cb875bcfb
refactor: rename sync io interfaces (#4945)
This commit renames sync io interfaces:
* SyncReader -> ReaderSync
* SyncWriter -> WriterSync
* SyncSeeker -> SeekerSync
2020-04-28 13:23:30 +02:00
Chris Knight
b980b26d85
doc: remove unstable API marker form Deno.Metrics and Deno.RunOptions (#4949) 2020-04-28 12:35:43 +02:00
Bartek Iwańczuk
8feb30e325
BREAKING: remove overload of Deno.test() (#4951)
This commit removes overload of Deno.test() that accepted named
function.
2020-04-28 12:33:09 +02:00
Bartek Iwańczuk
b508e84567
refactor: remove combined io interface like ReadCloser (#4944)
This commit removes "combined" interfaces from cli/js/io.ts; in the
like of "ReadCloser", "WriteCloser" in favor of using intersections
of concrete interfaces.
2020-04-28 12:32:43 +02:00
Bartek Iwańczuk
dea3ca39ba
refactor: rename SeekMode variants to camelCase and stabilize (#4946) 2020-04-28 12:30:59 +02:00
Luca Casonato
30dc9bb748
Make shutdown unstable and async (#4940) 2020-04-28 01:36:47 -04:00
Divya
de751e5221
fix(#4769) Adds readTextFile, writeTextFile, with sync counterparts (#4901) 2020-04-28 01:35:20 -04:00
Marcos Casagrande
2fc5878668
Change URL.port implementation to match WHATWG specifications (#4954)
Changed `URL.port` implementation to match [WHATWG
specifications](https://url.spec.whatwg.org/#port-state).

This PR matches the behaviour of other browsers:

1.  a `TypeError` must be thrown when passing an URL with an invalid
port to the constructor.

2. When setting an invalid port, using property setter, I haven't found
what should happen in this case, so I mimic **Firefox** & **Node**
behaviour. If an invalid port is set, it will use the previous value.
**Chrome** sets the value to `'0'` if an invalid port is set. I prefer
to keep the previous valid value.  (I can use Chrome's behaviour if you
think it's better, it's a simple value change)

```
url.port = '3000'; // valid
url.port = 'deno'; // invalid
assertEquals(url.port, '3000');
```

3. If the port value equals the current protocol default port value,
`port` will be an empty string.
2020-04-28 01:23:06 -04:00
Luca Casonato
15099cc016
Make Deno.kill unstable (#4950) 2020-04-27 23:36:43 -04:00
Ali Hasani
22b1a302f4
make utime unstable (#4955) 2020-04-27 21:14:47 -04:00
Bartek Iwańczuk
76641eb05e
refactor: remove stdio interfaces, use intersection types (#4952) 2020-04-28 02:01:00 +02:00
Luca Casonato
e6f70c77ee
Make import maps unstable (#4934) 2020-04-28 01:12:38 +02:00
Nayeem Rahman
4041a7b857
BREAKING: Remove Deno.symbols namespace (#4936) 2020-04-28 01:06:03 +02:00
Chris Knight
2f0641885c
docs: document default value of sanitizeOps and sanitizeResources (#4943) 2020-04-28 00:56:22 +02:00
Ryan Dahl
f2d5e6f58a
loadavg and osRelease made unstable (#4938) 2020-04-27 18:00:19 -04:00
Luca Casonato
95a08857f1
Make unix sockets require allow-write (#4939) 2020-04-27 16:56:24 -04:00
Brayden
a1974cbe43
Mark Deno.umask unstable (#4935) 2020-04-27 16:07:57 -04:00
Bert Belder
ee4e6a1ef9
Rename FileInfo time fields and represent them as Date objects (#4932)
This patch also increases the resolution of reported file times to
sub-millisecond precision.
2020-04-27 21:13:32 +02:00
uki00a
d440495b6b
fix(console): don't throw RangeError when an invalid date is passed (#4929) 2020-04-27 13:39:39 -04:00
Ryan Dahl
62976a1c94
signal APIs should require --unstable (#4926) 2020-04-27 13:38:23 -04:00
Bartek Iwańczuk
7a94ea08e9
fix(core): fix top-level-await error handling (#4911) 2020-04-27 17:25:26 +02:00
Ryan Dahl
dd0b25e313
Make Deno.setRaw and Deno.isatty unstable (#4925) 2020-04-27 10:54:55 -04:00
Ryan Dahl
3e9b0da346
Make Deno.dir unstable (#4924) 2020-04-27 16:53:56 +02:00
Ryan Dahl
4036be2ab2
Make runtime compile ops unstable (#4912) 2020-04-27 09:59:34 -04:00
Bartek Iwańczuk
1f52d180c0
refactor: factor out AstParser from DocParser (#4923) 2020-04-27 15:46:39 +02:00
Bartek Iwańczuk
8e9ab9e33e
refactor: decouple Console implementation from stdout (#4899)
When creating a console instance, one must pass "printFunc" arg
which is used internally by Console to output messages.

Due to numerous refactors there was a single method ("console.clear()")
that used "Deno.stdout" instead of "printFunc".

This commit unifies how "Console" outpus message, by using 
"printFunc" in all methods; consequently "Deno.stdout" is no longer
imported in "cli/js/console.ts" making it a standalone module that doesn't
depend on any CLI-specific APIs.
2020-04-27 15:40:47 +02:00
Bartek Iwańczuk
8e4333fd99
BREAKING: remove Deno.runTests() API (#4922)
Deno.runTests() interface is not yet good enough to be exposed
publicly with stability guarantees.

This commit removes public API related to testing: Deno.runTests()
and Deno.TestMessage, but keeps them exposed on Deno.internal object
so they can be used with "deno test" subcommand.
2020-04-27 14:51:22 +02:00
Ali Hasani
fe5b151755
feat(test): add quiet flag (#4894) 2020-04-27 13:05:26 +02:00
Marcos Casagrande
26dfd3c110
Add buffer size argument to copy (#4907) 2020-04-26 16:25:24 -04:00
Thiago Veronezi
fe6a670454
the scheme bits of an uri is case-insensitive; https://tools.ietf.org/html/rfc3986#section-3.1 (#4909) 2020-04-26 11:04:02 -04:00
Bartek Iwańczuk
62150dd328
BREAKING CHANGE: change return type of Deno.resources() (#4893) 2020-04-25 22:02:15 +02:00
Nayeem Rahman
b33685e94b
fix(cli/js/symbols): Update symbol descriptions (#4878)
Don't use Symbol.for() to define Deno.symbols.customInspect.
2020-04-25 10:53:26 -04:00
Ryan Dahl
0c47cd6785
introduce unstable flag, make a few things unstable (#4892) 2020-04-25 09:31:54 -04:00
Ryan Dahl
f8d83361cd
chdir should require --allow-write (#4889) 2020-04-24 19:55:33 -04:00
Bartek Iwańczuk
1378df3364
remove bootstrap methods from global scope after bootstrapping (#4869) 2020-04-25 01:03:45 +02:00
Bartek Iwańczuk
912a57f6a2
change type of stdio handles in JS api (#4891) 2020-04-25 01:01:25 +02:00
Bartek Iwańczuk
4a8d25646a
BREAKING CHANGE: remove Deno.OpenMode (#4884)
This commit removes Deno.OpenMode along with overloaded variants
of Deno.open() and Deno.openSync() that used OpenMode.
2020-04-25 00:45:55 +02:00
Bartek Iwańczuk
0cb1bb98cc
BREAKING CHANGE: change order of args in Deno.copy() (#4885) 2020-04-25 00:09:14 +02:00
Bartek Iwańczuk
833539fcaf
add help messages to Deno.test() sanitizers (#4887) 2020-04-25 00:07:25 +02:00
Bartek Iwańczuk
e9fa6b87ce
stabilize Deno.iter() and Deno.iterSync() (#4890) 2020-04-25 00:05:48 +02:00
Bartek Iwańczuk
824329f0da
BREAKING CHANGE: rename Deno.fsEvents() to Deno.watchFs() (#4886) 2020-04-24 23:40:29 +02:00
Bartek Iwańczuk
6a37e4426e
BREAKING CHANGE: rename TLS APIs to camel case (#4888)
This commit renames all APIs containing "TLS" to use camel case
(connectTLS -> connectTls, etc.)
2020-04-24 23:29:14 +02:00
Ryan Dahl
0da042c6fe
fix clippy (#4875) 2020-04-24 11:14:18 +02:00
David Sherret
f952d69eec
Parallelized deno fmt (#4823) 2020-04-23 19:01:15 -04:00
Bartek Iwańczuk
da6d0c2760
upgrade: Rust 1.43.0 (#4871) 2020-04-23 14:12:44 -04:00
Fenzland
cb935a375c
fix(#2142) make URLSearchParams more standardized (#4695) 2020-04-23 10:30:32 -04:00
Nayeem Rahman
65bba2b87e
refactor(cli/js/testing): Rename disableOpSanitizer to sanitizeOps (#4854)
* rename disableOpSanitizer to sanitizeOps
* rename disableResourceSanitizer to sanitizeResources
2020-04-23 14:40:16 +02:00
Ryan Dahl
d8711155ca
Rename deno_core::Isolate to deno_core::CoreIsolate (#4851) 2020-04-23 11:51:07 +02:00
Bert Belder
10a174834e
Upgrade to rusty_v8 v0.4.0 (#4856) 2020-04-23 03:35:52 +02:00
David Sherret
c43aaa3996
upgrade: dprint 0.13.1 (#4853)
* Allows union and intersection types to have same multi-line behaviour as arguments (more like prettier).
* Stops line breaks before `extends` in conditional type, which would have been a parser error.
* Check for `// dprint-ignore-file` comment before parsing. This allow files that panic in swc to be ignored.
* Fixes a bug in "multi-line" detection.
2020-04-22 19:20:38 -04:00
Bartek Iwańczuk
197a589a4a
fix Deno.iterSync() examples (#4855) 2020-04-22 18:36:04 -04:00
Ryan Dahl
e26c2cd7c8
Add comments in Reader/SyncReader about iter/iterSync (#4852) 2020-04-22 22:00:48 +02:00
Bartek Iwańczuk
68d287eed5
BREAKING CHANGE: rename Deno.toAsyncIterator() to Deno.iter() (#4848)
* rename Deno.toAsyncIterator() to Deno.iter()
* adds sync version Deno.iterSync()
* adds optional second argument for buffer size
2020-04-22 21:30:45 +02:00
Ryan Dahl
da6819a14c
Add comment distinguishing Deno.Buffer from Node's Buffer (#4847) 2020-04-22 14:26:16 -04:00
张超杰
08936c2efc
chore(docs): A space should be left after the single-line comment (#4811) 2020-04-22 10:21:05 -04:00
Kitson Kelly
8bcfc03d71
Rewrite streams (#4842) 2020-04-22 10:06:51 -04:00
张超杰
b270d6c8d0
typo 2020-04-21 16:11:52 -04:00
Ryan Dahl
cc1720132a
Move resource_table from deno::State to deno_core::Isolate (#4834) 2020-04-21 09:48:44 -04:00
Nayeem Rahman
ef6ee25e09
refactor(cli/fmt_errors): Improve source line formatting (#4832) 2020-04-20 15:39:02 -04:00
Ryan Dahl
6e5f3453f8
Remove core/plugin.rs (#4824)
This simplifies the plugin interface in order to deliver op crates with a similar API
2020-04-20 10:27:15 -04:00
Ryan Dahl
c1ec042a00
Modify op dispatcher to include &mut Isolate argument (#4821)
- Removes unnecessary RwLock and Rc around the op registry table
- Preparation to move resource_table to deno_core::Isolate.
- Towards #3453, #4222
2020-04-19 23:54:46 -04:00
Nayeem Rahman
4e3532fe7b
fix(core/js_errors): Get error's name and message from JS fields (#4808) 2020-04-19 15:17:22 +02:00
David Sherret
5292d24e6f
upgrade: dprint 0.13.0 (#4816) 2020-04-19 13:26:17 +02:00
Ryan Dahl
4d2b9cd37a
Fix Op definitions (#4814) 2020-04-18 20:05:13 -04:00
迷渡
ade05f3c00
fix(doc): Group ID (#4803) 2020-04-18 11:25:35 -04:00
EnokMan
47617e60d5
feat: startTLS (#4773) 2020-04-18 11:21:20 -04:00
Bartek Iwańczuk
10469ec279
store debugger url on DenoInspector (#4793) 2020-04-18 12:51:51 +02:00
迷渡
9d53a7a523
fix(doc): FileInfo.created is creation time (#4799) 2020-04-18 00:05:33 -04:00
Bartek Iwańczuk
41f836dc91
replace block_on in net interfaces (#4796) 2020-04-17 18:45:34 +02:00
Gudmund Vatn
260084ccbf
Add close method to Plugin (#4670) (#4785) 2020-04-17 12:51:10 +02:00
Nayeem Rahman
5bfe3eb8f4
feat(cli/installer.rs): Add DENO_INSTALL_ROOT (#4787) 2020-04-16 18:15:42 -04:00
Bartek Iwańczuk
d359789c52
feat: support Deno namespace in Worker API (#4784) 2020-04-16 23:40:29 +02:00
Bartek Iwańczuk
00fa4858b0
v0.41.0 2020-04-16 10:47:12 -04:00
Bartek Iwańczuk
0c48470b35
remove more calls to futures::executor::block_on (#4775) 2020-04-16 16:29:28 +02:00
trgwii
42c421f49d
Add @ for cleaner Batch files on Windows (#4764) 2020-04-16 01:42:09 -04:00
Nayeem Rahman
5ac728a5f1
refactor(cli/js/ops/fs): Improve readdir() and FileInfo interfaces (#4763) 2020-04-16 01:40:30 -04:00
Bartek Iwańczuk
aab26d226e
remove calls to futures::executor::block_on (#4760) 2020-04-15 23:14:28 -04:00
Ryan Dahl
fab0204cbf
Make writeSync, readSync, seekSync, openSync, isatty proper synchronous syscalls (#4762) 2020-04-15 20:43:19 -04:00
Kitson Kelly
cb64cf3ce2
Add support for AbortController/AbortSignal (#4757) 2020-04-15 10:10:49 -04:00
Nayeem Rahman
95eb6d780c
fix(cli/js/net): Make generator return types iterable (#4661) 2020-04-15 12:44:09 +02:00
Ryan Dahl
263dc8f5fe
Revert "test(inspector): add coverage test case (#4725)" (#4754)
Flaky and doesn't implement any features.

This reverts commit a7a3a771a0.
2020-04-15 11:26:31 +02:00
Bartek Iwańczuk
a7a3a771a0
test(inspector): add coverage test case (#4725) 2020-04-14 20:09:50 +02:00
Bartek Iwańczuk
e08ece2d2c
fix(worker): make worker name spec compliant (#4746) 2020-04-14 17:41:06 +02:00
Ryan Dahl
cb5dd69dda
upgrade: rust crates (#4742) 2020-04-14 09:31:29 -04:00
Ryan Dahl
ff60b31129
dedup various type definitions (#4741)
FormData FilePropertyBag DomFile BlobPropertyBag RequestCache 
RequestCredentials RequestDestination RequestMode RequestRedirect 
ResponseType
2020-04-14 09:23:07 -04:00
Ryan Dahl
360c05ffe7
dedup Headers types (#4736) 2020-04-13 22:46:23 -04:00
Luca Casonato
c915e4d77d
fix(doc): Added extends field to interface (#4739) 2020-04-14 00:28:49 +02:00
Luca Casonato
a9923f3f93
fix(doc): expose optionality in function params and class members (#4738) 2020-04-14 00:07:06 +02:00
Bartek Iwańczuk
2585b72c9b
feat: implement EventTarget for worker scope (#4737) 2020-04-13 22:18:31 +02:00
crowlKats
25bd6868e5
feat(worker): add MessageEvent, ErrorEvent and handling to Worker API (#4391)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-04-13 18:34:32 +02:00
Nayeem Rahman
0ea6eb83a9
refactor(core/js_error): Align JSStackFrame with CallSite (#4715)
Renames and adds missing fields to JSStackFrame from CallSite. Fixes #4705.

Cleans up base changes for line and column numbers.
2020-04-13 10:54:16 -04:00
Bartek Iwańczuk
5105c68399
workers: update postMessage and location types (#4734) 2020-04-13 16:48:12 +02:00
Khải
ef76389e42
Convert ProcessStatus to a tagged union (#4732) 2020-04-13 10:46:34 -04:00
迷渡
3a5dae4303
docs: highlight NO_COLOR (#4723) 2020-04-11 23:12:42 -04:00
Ryan Dahl
637a9ecd6a
dedup URLSearchParams, URL, Location, DOMStringList (#4719) 2020-04-11 17:19:36 -04:00
Ryan Dahl
da28fc1e7b
dedup type declarations (#4718)
Blob, BlobPart, BufferSource, ReferrerPolicy, BlobPart, AbortSignal, AbortSignalEventMap
2020-04-11 16:25:31 -04:00
David Yamnitsky
0641ad0d9b
deno install should also accept log level flags for installed script (#4714) 2020-04-11 11:47:27 -04:00
Kitson Kelly
fc4819e1e0
refactor: Event and EventTarget implementations (#4707)
Refactors Event and EventTarget so that they better encapsulate their
non-public data as well as are more forward compatible with things like
DOM Nodes.

Moves `dom_types.ts` -> `dom_types.d.ts` which was always the intention,
it was a legacy of when we used to build the types from the code and the
limitations of the compiler.  There was a lot of cruft in `dom_types`
which shouldn't have been there, and mis-alignment to the DOM standards.
This generally has been eliminated, though we still have some minor
differences from the DOM (like the removal of some deprecated
methods/properties).

Adds `DOMException`.  Strictly it shouldn't inherit from `Error`, but
most browsers provide a stack trace when one is thrown, so the behaviour
in Deno actually better matches the browser.

`Event` still doesn't log to console like it does in the browser.  I
 wanted to get this raised and that could be an enhancement later on (it
 currently doesn't either).
2020-04-11 11:42:02 -04:00
Nayeem Rahman
2b362bef85
refactor(cli/fmt_errors): Format stack frames in prepareStackTrace() (#4706) 2020-04-11 02:08:11 -04:00
gewoonwoutje
2feb661b85
Replace panic with invalid_utf8 OpError (#4704)
Co-authored-by: Wout Elstgeest <w.elstgeest@inepro.com>
2020-04-10 22:14:16 -04:00
Ryan Dahl
2af9f5f2cf
Remove __domTypes namespace (#4698) 2020-04-10 14:24:42 -04:00
Nayeem Rahman
8b4508338b
fix(core/js_error): Get frame data from prepareStackTrace() (#4690)
Fixes: #2703
Fixes: #2710
Closes: #4153
Closes: #4232

Co-authored-by: Kevin (Kun) Kassimo Qian <kevinkassimo@gmail.com>
2020-04-10 18:26:52 +02:00
Ryan Dahl
02bc58d832
BREAKING: Make fetch API more web compatible (#4687)
- Removes the __fetch namespace from `deno types`
- Response.redirect should be a static.
- Response.body should not be AsyncIterable.
- Disables the deno_proxy benchmark
- Makes std/examples/curl.ts buffer the body before printing to stdout
2020-04-10 09:51:17 -04:00
Bartek Iwańczuk
be71885628
implement Worker.terminate() and self.close() (#4684) 2020-04-10 00:15:17 +02:00
Chris Knight
2becae884e
BREAKING: Remove deprecated mkdir, mkdirSync APIs (#4615) 2020-04-09 11:15:56 -04:00
Nayeem Rahman
71ac552249
feat(cli/doc): Support doc for runtime built-ins (#4635) 2020-04-09 14:34:24 +02:00
Ryan Dahl
198a045dbe
Remove __event, __eventTarget, __customEvent namespaces (#4683) 2020-04-09 12:03:44 +02:00
Ryan Dahl
0cf4ac91e6
v0.40.0 2020-04-08 14:59:06 -04:00
Ryan Dahl
b7e673ba93
upgrade: rust crates (#4679) 2020-04-08 14:29:42 -04:00
Ryan Dahl
dd2d19b22d
Remove __blob and __console namespaces (#4677) 2020-04-08 13:21:04 -04:00
Bartek Iwańczuk
491b8e1cea
feat(doc): handle function params and type params (#4672) 2020-04-08 17:03:42 +02:00
Ryan Dahl
fe17496831
Remove extra copy of URLSearchParams (#4675) 2020-04-08 10:32:08 -04:00
Ryan Dahl
efff39a3ac
Remove panic catch around dprint calls (#4676)
dprint seems to be stable enough to not panic on our own source code
now.
2020-04-08 10:31:48 -04:00
Ryan Dahl
b4836be57e
Remove __io namespace (#4669) 2020-04-08 01:30:51 +02:00
Ryan Dahl
f07fcfcc80
Remove __url namespace (#4668) 2020-04-07 17:11:38 -04:00
Ryan Dahl
6660fb25c9
Remove __workers namespace (#4665) 2020-04-07 15:03:14 -04:00
Bartek Iwańczuk
86fd0c66a6
feat(doc): handle basic reexports (#4625) 2020-04-07 19:47:06 +02:00
Ryan Dahl
51f5276e8c
Remove __textEncoding and __performanceUtil namespaces (#4663) 2020-04-07 13:27:37 -04:00
Akshat Agarwal
caff550b6c
BREAKING: Rename 'deno fetch' subcommand to 'deno cache' (#4656) 2020-04-07 11:24:47 -04:00
Ryan Dahl
62726430be
Remove __timers namespace (#4662) 2020-04-07 11:12:31 -04:00
Bartek Iwańczuk
dd3a94933a
feat: add --importmap flag to deno bundle (#4651) 2020-04-07 12:32:09 +02:00
Giorgi Rostomashvili
f82b9ba329
fix: fetch reference types for JS files (#4652)
Fixes #4000 and fixes #4476. Now always tries to fetch reference types
for JS files. Does not throw if it fails, since Typescript compiler will
complain if the file is not there(it will try to fetch it again first)
and people who just use JS should not be bothered by this error.

Not sure about my test, it passes and catches the bug but maybe there is
a better way to express it.
2020-04-06 16:52:25 -04:00
Yusuke Sakurai
b9e5e4c7ec
fix: test_create_cache_if_dir_not_exit (#4636)
This test doesn't remove created directory after test. It will fail on next run.
2020-04-06 10:08:53 -04:00
Ondřej Žára
0ea9562933
docs: add README to cli/js/web/ (#4578) 2020-04-06 13:06:11 +02:00
crowlKats
6720a0dc02
feat: Add File support in FormData (#4632) 2020-04-05 15:49:04 -04:00
Andres Villegas
2911fcc78d
Enable inspector tests (#4628) 2020-04-04 14:46:09 -04:00
Lorran Rosa
b017409dcd
on init create disk_cache directory if it doesn't already exists (#4617) 2020-04-03 22:43:49 -04:00
Kitson Kelly
f527407287
clippy (#4618) 2020-04-03 22:41:16 -04:00
Parker Gabel
0db04d6a42
fix(#4546) Added Math.trunc to toSecondsFromEpoch to conform the result to u64 (#4575) 2020-04-03 15:20:40 -04:00
Yusuke Sakurai
2426174485
feat: Expose ReadableStream and make Blob more standardized (#4581)
Co-authored-by: crowlkats <crowlkats@gmail.com>
2020-04-03 14:55:23 -04:00
Ryan Dahl
cb0acfe305
v0.39.0 2020-04-03 14:38:56 -04:00
dubiousjim
6f9c78979d
Properly handle invalid utf8 in paths (#4609) 2020-04-03 13:47:57 -04:00
dubiousjim
c5c3abc517
adjust docs for Deno.seek (#4610) 2020-04-03 13:45:44 -04:00
Bert Belder
c0cb198114
Make inspector more robust, add --inspect-brk support (#4552) 2020-04-03 13:40:11 -04:00
Bartek Iwańczuk
3f489ae1ae
fix: async ops sanitizer false positives in timers (#4602) 2020-04-03 19:20:36 +02:00
Bartek Iwańczuk
efb022a50c
upgrade dprint to 0.9.10 (#4601) 2020-04-03 18:35:03 +02:00
Bartek Iwańczuk
e99374a0a3
make Worker.poll private (#4603) 2020-04-03 18:01:45 +02:00
dubiousjim
ce02167c75
Improve tests and docs for Deno.rename (#4597) 2020-04-03 11:00:16 -04:00
Ondřej Žára
6204555be3
"deno doc" parses the "implements" clause of a class def (#4604) 2020-04-03 14:11:50 +02:00
Ondřej Žára
b57d075c07
deno doc parses super-class names (#4595)
Co-Authored-By: Luca Casonato <luca.casonato@antipy.com>
2020-04-03 10:32:46 +02:00
dubiousjim
7a9273d9cf
Refactor and expand mkdir tests (#4579) 2020-04-02 14:54:33 -04:00
Ryan Dahl
c738797944
feat: deno test --filter (#4570) 2020-04-02 09:26:40 -04:00
Luca Casonato
3d56f3afca
Added 'declare' handling to 'deno doc' (#4573) 2020-04-02 11:38:13 +02:00
Kitson Kelly
2e24385c48
Support dynamic import in bundles. (#4561) 2020-04-01 23:14:30 -04:00
Marcus Weiner
2ff8012dcc
Expose global state publicly (#4572) 2020-04-01 19:41:32 -04:00
Chris Knight
1c30d755bf
better parameter names for a couple functions (#4559) 2020-04-01 12:57:33 -04:00
木杉
6291ac82ee
fix(#4554): use --inspect in repl & eval (#4562) 2020-04-01 09:35:34 -04:00
Nayeem Rahman
270e87d9db
refactor(cli/js/testing): Reduce testing interfaces (#4451)
* Reduce "testing" interfaces
* Use a callback instead of a generator for Deno.runTests()
* Default RunTestsOptions::reportToConsole to true
* Compose TestMessage into a single interface
2020-04-01 10:47:23 +02:00
Chris Knight
857d96001d
doc: Improve API documentation and add examples (#4548) 2020-03-31 23:21:37 -04:00
crowlKats
7b675a332c
fix: invalid blob type (#4536) 2020-03-31 14:42:18 -04:00
dubiousjim
d4d0b5d90c
Properly track isFile, isSymlink, isDirectory (#4541)
* Properly track isFile, isSymlink, isDirectory

These don't exhaust all the possibilities, so none of them should be
defined as "neither of the others".

* empty
2020-03-31 13:46:25 -04:00
dubiousjim
bdcb926b37
Fix umask test (#4533) 2020-03-30 19:02:02 -04:00
Michał Sabiniarz
30fdf6dc83
console: print promise details (#4524) 2020-03-30 19:01:19 -04:00
Michał Sabiniarz
4b71ac550e
console: iterable printing improvements (#4472)
1. Array elements are now grouped the same as in Node.js
2. Limit to 100 (Node.js default) elements to display in iterable
3. Print each element in new line if excessing max line length (same as in Node.js)
4. Print length of the TypedArray
5. Print information about empty items in Array
2020-03-30 13:45:37 -04:00
Luca Casonato
d795d34362
fix(doc): Safely deal with optional type (#4526) 2020-03-29 22:41:27 -04:00
Chris Knight
e88dcdc5e1
API doc improvments (#4525) 2020-03-29 21:39:10 -04:00
Ryan Dahl
6ae47449ec
Ignore flaky test cafile_info (#4517)
Ref #4512
2020-03-28 22:51:30 +01:00
Kevin (Kun) "Kassimo" Qian
2f7842246e
fix(inspector): proper error message on port collision (#4514) 2020-03-28 17:42:29 -04:00
Luca Casonato
ad198b1cf1
feat: Added colors to doc output (#4518) 2020-03-28 17:35:31 -04:00
Ryan Dahl
d6cb3892d4
v0.38.0 2020-03-28 15:26:58 -04:00
Bartek Iwańczuk
3fac487461
feat: Add "deno doc" subcommand (#4500) 2020-03-28 14:16:57 -04:00
Kitson Kelly
bced52505f
Update to Prettier 2 and use ES Private Fields (#4498) 2020-03-28 13:03:49 -04:00
Kitson Kelly
1397b8e0e7
upgrade: dprint 0.9.6 (#4509) 2020-03-28 10:04:18 -04:00
Ryan Dahl
2874664e91
feat: Support Inspector / Chrome Devtools (#4484)
This is a first pass implementation which is still missing several important
features:
- support for --inspect-brk (#4503)
- support for source maps (#4501)
- support for piping console.log to devtools console (#4502)

Co-authored-by: Bert Belder <bertbelder@gmail.com>
Co-authored-by: Matt Harrison <mt.harrison86@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-03-27 16:09:51 -04:00
Chris Knight
8bcdb422e3
Improve isatty and kill API docs; Deno.kill() - throw on Windows (#4497) 2020-03-26 15:52:47 -04:00
Chris Knight
a053462566
refactor: rename ConsoleOptions to InspectOptions (#4493) 2020-03-25 20:48:47 -04:00
Ryan Dahl
fd432e2346
upgrade: dprint 0.9.5 (#4491) 2020-03-25 17:24:26 -04:00
Kevin (Kun) "Kassimo" Qian
5d7bcf86fd
feat: window.close() (#4474) 2020-03-24 23:56:40 -04:00
Kevin (Kun) "Kassimo" Qian
3938071e91
errors: replace .lines with explicit .split newline (#4483) 2020-03-24 23:55:54 -04:00
Chris Knight
eeedb416c0
doc: improve various API docs and include examples (#4486) 2020-03-24 23:54:41 -04:00
Kevin (Kun) "Kassimo" Qian
3d228f5f9e
hide source line if error message longer than 150 chars (#4487) 2020-03-24 23:53:48 -04:00
Kevin (Kun) "Kassimo" Qian
addfdc4cd0
fix: add fsEvent notify::Error casts (#4488) 2020-03-24 23:50:51 -04:00
Yusuke Sakurai
07fc95acee
feat: add queueMicrotask to d.ts (#4477) 2020-03-24 13:39:41 -04:00
Bartek Iwańczuk
30bcf6a2ea
Revert "avoid using same port number for test (#4147)"
Ref #4467

This reverts commit 60cee4f045.
2020-03-24 12:24:58 -04:00
Michał Sabiniarz
2e5e5fe393
console: replace object abbreviation with line breaking (#4425) 2020-03-24 00:57:05 -04:00
Kevin (Kun) "Kassimo" Qian
c61a231ff4
remove extra dot in Permission request output (#4471) 2020-03-24 00:54:17 -04:00
João Souto
70a5034431
feat: Support Unix Domain Sockets (#4176) 2020-03-23 18:02:51 -04:00
Ryan Dahl
b924e5ab7e
v0.37.1 2020-03-23 17:14:34 -04:00
Ryan Dahl
d143fe61bc
v0.37.0 2020-03-23 12:28:27 -04:00
bartOssh
ec07386067
feat: first pass at "deno upgrade" (#4328) 2020-03-23 11:37:24 -04:00
Chris Knight
a0ba476fee
doc: API improvements to chown, close, compile and connect (#4463) 2020-03-23 00:03:45 -04:00
Ryan Dahl
12ff78ed4c
Remove @url comments from d.ts files (#4449)
These have no function and are not tested, probably incorrect in many
situations.
2020-03-21 17:58:31 -04:00
Akshat Agarwal
b8a5c29bf8
BREAKING CHANGE Rename Deno.run's args to cmd (#4444)
This is to avoid confusion with Deno.args which does not include the 
executable to be run.
2020-03-21 17:44:18 -04:00
Yusuke Sakurai
60cee4f045
avoid using same port number for test (#4147) 2020-03-21 09:53:47 -04:00
Ryan Dahl
0adc86f105
Remove DENO_BUILD_MODE and DENO_BUILD_PATH (#4431)
* Remove DENO_BUILD_MODE and DENO_BUILD_PATH

Also remove outdated docs related to ninja/gn.

* fix

* remove parameter to build_mode()

* remove arg parsing from benchmark.py
2020-03-20 21:48:34 -04:00
dubiousjim
77a44163fb
chmod should throw on Windows (#4446) 2020-03-20 16:03:04 -04:00
dubiousjim
1c6f177d19
use prebuilt "not implemented" error (#4442) 2020-03-20 12:10:02 -04:00
dubiousjim
69303e2149
refactor: move code from fs.rs into ops/fs.rs (#4428)
This a complex boring PR that shifts around code (primarily) in cli/fs.rs and
cli/ops/fs.rs. The gain of this refactoring is to ease the way for #4188 and
#4017, and also to avoid some future development pain.

Mostly there is no change in functionality. Except:
* squashed bugs where op_utime and op_chown weren't using `resolve_from_cwd`
* eliminated the use of the external `remove_dir_all` crate.
* op_chmod now only queries metadata to verify file/dir exists on Windows (it
  will already fail on Unix if it doesn't)
* op_chown now verifies the file/dir's existence on Windows like chmod does.
2020-03-20 09:46:26 -04:00
Samrith Shankar
798904b0f2
Add require-await lint rule (#4401) 2020-03-20 09:38:34 -04:00
Ryan Dahl
a6d8098b35
Clean up installer tests (#4433) 2020-03-19 17:20:46 -04:00
Bartek Iwańczuk
87d2ba42bf
perf: Optimize TextEncoder and TextDecoder (#4430)
* add tests for "Deno.core.encode" and "Deno.core.decode" for empty inputs
* use "Deno.core.encode" in "TextEncoder"
* use "Deno.core.decode" in "TextDecoder"
* remove "core_decode" and "core_encode" benchmarks
2020-03-19 21:31:56 +01:00
Ryan Dahl
392d2c1118
Fix cafile_install_remote_module test (#4429) 2020-03-19 12:46:56 -04:00
Kevin (Kun) "Kassimo" Qian
2f3de4b425
Simplify timer with macrotask callback (#4385) 2020-03-19 10:45:28 -04:00
Nikolai Vavilov
8c1c929034
fix: stack traces for modules imported via std/node's require (#4035) 2020-03-19 10:42:07 -04:00
Bartek Iwańczuk
74c37e759a
remove std/testing/runner.ts, use deno test for std/ tests (#4397)
This introduces BREAKING CHANGE by removing "std/testing/runner.ts".

Std tests are now run using "deno test" subcommand.
2020-03-19 14:49:06 +01:00
Bartek Iwańczuk
8de4a05f2a
fix: std/testing/runner.ts and deno test (#4392)
After splitting "failFast" and "exitOnFail" arguments, there was a situation where failing tests did not exit with code 1.

* fixed argument value passed to Deno.runTests() in deno test
* fixed argument value passed to Deno.runTests() in std/testing/runner.ts
* added integration tests for deno test to ensure failFast and exitOnFail work as expected
* don't write test file to file system, but keep it in memory
2020-03-19 14:26:47 +01:00
Bartek Iwańczuk
b0b27c4310
refactor: rename Deno.TestDefinition.skip to ignore (#4400) 2020-03-19 10:58:12 +01:00
Chris Knight
54d1f299dc
Chmod API documentation improvements (#4427) 2020-03-18 21:25:01 -04:00
Chris Knight
2a34cbfaf9
Improve API docs for Deno.bundle and Deno.chdir (#4426) 2020-03-18 19:40:06 -04:00
Bartek Iwańczuk
6e2df8c64f
feat: Deno.test() sanitizes ops and resources (#4399)
This PR brings assertOps and assertResources sanitizers to Deno.test() API.

assertOps checks that test doesn't leak async ops, ie. there are no unresolved
promises originating from Deno APIs. Enabled by default, can be disabled using 
Deno.TestDefinition.disableOpSanitizer.

assertResources checks that test doesn't leak resources, ie. all resources used
in test are closed. For example; if a file is opened during a test case it must be
explicitly closed before test case finishes. It's most useful for asynchronous
generators. Enabled by default, can be disabled using 
Deno.TestDefinition.disableResourceSanitizer.

We've used those sanitizers in internal runtime tests and it proved very useful in
surfacing incorrect tests which resulted in interference between the tests.

All tests have been sanitized.

Closes #4208
2020-03-18 19:25:55 -04:00
Bert Belder
070464e2cc
Fix unit test runner ConnectionReset bug (#4424)
Fixes: #4373
2020-03-18 12:13:01 -07:00
Kitson Kelly
da8cb408c8
Provide compiled JSON to TypeScript compiler. (#4404)
Fixes #4101

Previously, we would just provide the raw JSON to the TypeScript
compiler worker, but TypeScript does not transform JSON.  This caused
a problem when emitting a bundle, that the JSON would just be "inlined"
into the output, instead of being transformed into a module.

This fixes this problem by providing the compiled JSON to the TypeScript
compiler, so TypeScript just sees JSON as a "normal" TypeScript module.
2020-03-18 12:39:53 -04:00
Bert Belder
a2b2851582
Upgrade rust crates (#4412) 2020-03-17 17:42:22 -07:00
Bartek Iwańczuk
4a4894532e
try to handle ConnectionReset error in windows CI for unit tests (#4407) 2020-03-17 17:35:38 -04:00
crowlKats
9833975ef2
feat: fetch should accept a FormData body (#4363) 2020-03-17 02:32:43 -04:00
dubiousjim
f9557a4ff6
Add mode option to open/create (#4289) 2020-03-16 15:02:41 -04:00
Gurwinder Singh
8077ade741
refactor: remove an unsafe and some boxing (#4398) 2020-03-16 10:46:31 -07:00
Bartek Iwańczuk
0d14a7bd53
try to fix unit test runner on Windows (#4395)
This PR attempts to fix intermittent errors occurring on Windows for "cli/tests/unit_test_runner.ts." Runner has been reworked to create only single TCP listener instead of one listener per worker.
Additionally worker doesn't close TCP socket - it waits for parent process to close the socket and only then exits.
2020-03-16 16:50:58 +01:00
Bartek Iwańczuk
7d0b77440e
fix: fetch closes unused body (#4393)
This commit makes sure that "httpBody" resource is closed in case of redirections in fetch API.
2020-03-16 15:32:29 +01:00
Kevin (Kun) "Kassimo" Qian
49541a04d2
console: Symbol.toStringTag and display Object symbol entries (#4388) 2020-03-16 09:05:39 -04:00
Bartek Iwańczuk
1edb20b399
refactor: add no-return-await lint rule (#4384) 2020-03-16 10:22:16 +01:00
Bartek Iwańczuk
70434b5bfb
refactor: change test reporter output (#4371)
This commit changes output of default test reporter to resemble output from Rust test runner;
first the name of running test is printed with "...", then after test has run result is printed on the same line.

* Split "Deno.TestEvent.Result" into "TestStart" and "TestEnd";
* changes TestReporter interface to support both events; 

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-03-15 17:58:59 +01:00
Bartek Iwańczuk
dc6e0c3591
feat: Deno.core.{encode,decode}; standalone UTF-8 encoding/decoding (#4349)
This commits add two new methods to "Deno.core" namespace: "encode" and "decode".

Those methods are bound in Rust to provide a) fast b) generally available of encoding and decoding UTF-8 strings. 

Both methods are now used in "cli/js/dispatch_json.ts".
2020-03-15 15:31:55 +01:00
Kitson Kelly
2f4be6e944
Remove Object.prototype.__proto__ (#4341) 2020-03-15 11:34:22 +01:00
Nayeem Rahman
64a35acd64
feat(cli/js/testing): Add TestDefinition::skip (#4351) 2020-03-15 10:34:24 +01:00
dubiousjim
6cc40b0865
BREAKING CHANGE FileInfo.len renamed to FileName.size (#4338) 2020-03-14 22:57:42 -04:00
Bartek Iwańczuk
bf51f7b2ec
replace source-mappings-map with rust-sourcemap (#4368) 2020-03-14 22:10:23 +01:00
Kitson Kelly
ba687125e7
Add support for jsx/tsx for deno test (#4369) 2020-03-14 13:23:53 +01:00
Bartek Iwańczuk
d6bbbdda75
Update CLI for unit_test_runner.ts (#4352)
* drop server guard before unit test result check

To prevent cascading test failures when js_unit_test http server
guard is dropped before asserting that tests were successful.
This is really a band-aid and doesn't solve underlying issue with
http server.

* Update CLI for unit_test_runner.ts

* Change cli/js/tests/unit_test_runner.ts command line interface to work in 3
  modes:
  - "one-off" - run tests that match permissions of currently running
    process
  - "master" - run tests for all possible permission combinations, by
   spawning subprocesses running in "worker" mode and communicating via
   TCP socket; requires elevated permissions
  - "worker" - run tests for set of permissions provided by CLI arg;
  requires elevated permissions to setup TCP connection to "master";
  after initial setup process drops permissions to given set

* Support filtering of tests by string passed after "--" CLI arg

* Update cli/js/tests/README.md
2020-03-14 11:53:20 +01:00
Bartek Iwańczuk
aab1acaed1
refactor: unit test runner communicates using TCP socket (#4336)
Rewrites "cli/js/unit_test_runner.ts" to communicate with spawned subprocesses 
using TCP socket.

* Rewrite "Deno.runTests()" by factoring out testing logic to private "TestApi" 
  class. "TestApi" implements "AsyncIterator" that yields "TestEvent"s, 
  which is an interface for different types of event occuring during running
  tests.

* Add "reporter" argument to "Deno.runTests()" to allow users to provide custom
  reporting mechanism for tests. It's represented by "TestReporter" interface,
  that implements hook functions for each type of "TestEvent". If "reporter"
  is not provided then default console reporting is used (via 
  "ConsoleReporter").

* Change how "unit_test_runner" communicates with spawned suprocesses. Instead
  of parsing text data from child's stdout, a TCP socket is created and used
  for communication. "unit_test_runner" can run in either "master" or "worker"
  mode. Former is responsible for test discovery and establishing needed
  permission combinations; while latter (that is spawned by "master") executes
  tests that match given permission set.

* Use "SocketReporter" that implements "TestReporter" interface to send output
  of tests to "master" process. Data is sent as stringified JSON and then
  parsed by "master" as structured data. "master" applies it's own reporting 
  logic to output tests to console (by reusing default "ConsoleReporter").
2020-03-13 15:57:32 +01:00
crowlKats
e435c2be15
Remove doc strings from cli/js TS files (#4329)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-03-13 10:22:22 +01:00
Ryan Dahl
3ac642c183
upgrade: Rust 1.42.0 (#4331) 2020-03-12 18:07:57 +01:00
Ryan Dahl
63cee35691
Enable std tests in debug mode (#4332) 2020-03-12 17:12:20 +01:00
Ryan Dahl
3ed6ccc905
v0.36.0 2020-03-11 19:13:01 -04:00
João Souto
fb5c31416d
Add waker to StreamResource to fix hang on close bugs (#4293) 2020-03-11 18:19:24 -04:00
Bartek Iwańczuk
810e4a16be
reorg: Deno global initialization (#4317) 2020-03-11 21:57:24 +01:00
Bartek Iwańczuk
b8fa3fd5e7
move compiler API tests to integration tests (#4319) 2020-03-11 21:54:53 +01:00
dubiousjim
a28fa2415f
support permission mode in mkdir (#4286) 2020-03-11 16:14:23 -04:00
dubiousjim
72c408ea9d
Stricter permissions for Deno.makeTemp* (#4318) 2020-03-11 15:05:42 -04:00
Bartek Iwańczuk
2d1b39bef3
reorg: remove dispatch.ts, move signals, factor out web utils (#4316)
- moves signal definition from "cli/js/process.ts" to "cli/js/signals.ts"
- removes "cli/js/dispatch.ts"
- removes "cli/js/types.ts"
- moves web specific utilities to "cli/js/web/util.ts"
2020-03-11 15:49:53 +01:00
Bartek Iwańczuk
99a0c6df79
reorg: cli/js/compiler/, move more API to cli/js/web/ (#4310)
- moves compiler implementation to "cli/js/compiler/" directory
- moves more APIs to "cli/js/web":
    * "console.ts"
    * "console_table.ts"
    * "performance.ts"
    * "timers.ts"
    * "workers.ts"
- removes some dead code from "cli/js/"
2020-03-11 10:53:06 +01:00
Ryan Dahl
94f4c6807a
Improve dprint config (#4314) 2020-03-11 10:51:57 +01:00
Nayeem Rahman
ce14ef09d0
doc(cli/flags): Reduce empty lines in help messages (#4312) 2020-03-10 19:23:08 -04:00
Nayeem Rahman
55119aaee2
refactor(cli/js/net): Cleanup iterable APIs (#4236)
Listener and UDPConn are AsyncIterables instead of AsyncIterators.
The [Symbol.asyncIterator]()s are defined as generators and the
next() methods are gone.

"Listener/Socket has been closed" errors are now BadResource.
2020-03-10 15:14:22 -04:00
dubiousjim
8078d976d2
Add Deno.umask (#4290) 2020-03-10 15:11:27 -04:00
Nayeem Rahman
6443e4aed1
refactor: Cleanup options object parameters (#4296) 2020-03-10 12:08:58 -04:00
Bartek Iwańczuk
fbc4731256
refactor: uncomment tests broken tests, use skip (#4311)
* uncomment broken tests, use skip:
- net_test.ts 
- url_test.ts
- fetch_test.ts
2020-03-10 16:38:02 +01:00
Florian Häglsperger
62f4a2a788
Add global "quiet" flag (#4135) 2020-03-10 08:26:17 -04:00
Bartek Iwańczuk
dca00211ab
use Object instead of Map for promise table (#4309) 2020-03-09 22:04:49 -04:00
Bartek Iwańczuk
68119e1d7e
reorg: move js runtime tests to cli/js/tests/ (#4250)
All Deno runtime test files were moved to cli/js/tests/ directory.

It makes a clear distinction that cli/js/tests/ contains code
that is run under Deno runtime as opposed to code in cli/js/ which
is used to create bundle and snapshot with "deno_typescript".
2020-03-10 01:06:47 +01:00
Ryan Dahl
dad8036766
upgrade: dprint 0.8.0 (#4308) 2020-03-10 01:01:33 +01:00
Bartek Iwańczuk
b7eb241c35
reorg: move JS ops implementations to cli/js/ops/, part 3 (#4302)
Following JS ops were moved to separate files in cli/js/ops directory:
- net
- tls
- fs
2020-03-10 00:22:15 +01:00
Bartek Iwańczuk
886f330ec8
reorg: move JS ops implementations to cli/js/ops/, part 2 (#4283)
Following JS ops were moved to separate files in cli/js/ops directory:
- io
- process
- worker_host
- web_worker
- plugins
- timers
- signal
- permissions
2020-03-09 15:18:02 +01:00
Yusuke Sakurai
6f0b70eb1e
disable test_raw_tty (#4282) 2020-03-08 17:10:45 +01:00
Bartek Iwańczuk
1b6f831875
reorg: move JS ops implementations to cli/js/ops/, part 1 (#4264)
Following JS ops were moved to separate files in cli/js/ops directory:
- compiler
- dispatch_json
- dispatch_minimal
- errors
- fetch
- fs_events
- os
- random
- repl
- resources
- runtime_compiler
- runtime
- tty
2020-03-08 13:09:22 +01:00
dubiousjim
0dd131d4a5
Rename perm to mode (#4276)
There's a lot of variation in doc comments and internal code about
whether chmod/0o777-style permissions are called `mode` or `perm`. (For
example, mkdir and writeFile choose differently.)

Had proposed earlier to go consistently with `perm`, but on balance devs
prefer to go with `mode`.
2020-03-07 22:29:12 -05:00
Ryan Dahl
18076db8f0
upgrade rust dependencies (#4270) 2020-03-07 15:51:23 -05:00
Bartek Iwańczuk
88b77da25c
refactor: remove cli/ops/files.rs (#4246)
* "op_close" - moved to "cli/ops/resources.rs"
* "op_seek", "op_open" - moved to "cli/ops/fs.rs"

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-03-07 13:20:27 +01:00
Ryan Dahl
ec1946a95e
Improve run_and_collect_output (#4272)
* Fix flaky test test_permissions_net_listen_allow_localhost

* Improve error reporting for run_and_collect_output
2020-03-07 11:27:16 +01:00
Ryan Dahl
61f12ea775
Fix flaky test test_permissions_net_listen_allow_localhost (#4271) 2020-03-06 17:40:18 +01:00
Aurélien Bertron
5e31b96f9a
Add content type for wasm, fix encoding in wasm test fixture (#4269) 2020-03-06 11:31:22 -05:00
dubiousjim
acf0958e94
Rename name/filename arguments to path (#4227)
There's a lot of variation in doc comments and internal code about
whether the first parameter to file system calls is `path` or `name` or
`filename`. For consistency, have made it always be `path`.
2020-03-06 11:29:23 -05:00
João Souto
e81fb25b7a
Fix unwanted ANSI Reset Sequence (#4268) 2020-03-06 08:48:38 -05:00
dubiousjim
9a63902db5
Rename readDir -> readdir (#4225) 2020-03-06 08:34:02 -05:00
Ryan Dahl
afea9b2edd
fix: call unwatch when dropping FsEventsResource (#4266) 2020-03-05 20:01:08 -05:00
Bartek Iwańczuk
2e59007214 move Web APIs to cli/js/web/ 2020-03-05 18:48:55 +01:00
Bartek Iwańczuk
9b59ed7c79 fix event target tests 2020-03-05 11:09:04 -05:00
Ryan Dahl
c850b258b4
Support async function and EventListenerObject as listeners (#4240) 2020-03-05 08:36:13 -05:00
Ryan Dahl
54a1688868
Allow BadResource errors to take a custom message (#4251) 2020-03-05 08:30:41 -05:00
Bartek Iwańczuk
20dad3659c
refactor: preliminary cleanup of Deno.runTests() (#4237)
* refactor: preliminary cleanup of Deno.runTests()

* Change time measurement to use new Date() instead of
  performance.now(). Because there is no guarantee that tests are
  run with "--allow-hr" using new Date() guarantees higher
  precision of 1ms instead of 2ms.

* Support String type filter in "skip" and "only".

* Split "exitOnFail" into "exitOnFail" and "failFast".
  Former tells if "runTests()" should exit with code 1 on test
  failure, while latter tells if "runTests()" should stop
  running tests on first failure.

* Use "defer" to wait for unhandled promise rejection - this bit
  is funky and doesn't seem right, but for now it's just a rewrite
  from using "setTimeout". Intended to be fixed in later commits.

* Remove global "__DENO_TEST_REGISTRY", don't expose list of
  registered tests (to be addressed in follow up commits)

* Remove arbitrary slow test threshold; use uniform coloring
  instead
2020-03-05 11:52:18 +01:00
Bartek Iwańczuk
52b96fc22a
refactor: cleanup compiler runtimes (#4230)
- Cleanup "tsCompilerOnMessage" by factoring out separate methods for each 
  request type:
    * "compile"
    * "runtimeCompile"
    * "runtimeTranspile"
- Simplify control flow of compiler workers by a) no longer calling "close()" in worker runtime after a
single message; b) explicitly shutting down worker from host after a single message

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-03-05 11:13:10 +01:00
Bert Belder
5d3dfa4cf6
Remove unnecessary macro from cli/ops/tty.rs (#4254)
It contains a clippy issue, and there's no need for this macro anyway.
2020-03-04 15:54:09 -08:00
Ryan Dahl
a1b98e9e6a
Remove Deno.errors.Other (#4249) 2020-03-04 13:18:32 -05:00
Bartek Iwańczuk
8d96dffa41
refactor: rewrite testPerm into unitTest (#4231)
Rewrite "testPerm" helper function used for testing of internal 
runtime code. It's been renamed to "unitTest" and provides API that
is extensible in the future by accepting optional "UnitTestOptions" 
argument. "test" helper was also removed and replaced by
overloaded version of "unitTest" that takes only function argument.

"UnitTestOptions" currently supports "perms" and "skip"
options, where former works exactly as first argument to "testPerm"
did, while the latter allows to conditionally skip tests.
2020-03-04 17:31:14 +01:00
Kitson Kelly
30682cf74f
Migrate internal bundles to System (#4233) 2020-03-04 14:26:00 +01:00
yuta0801
5e7ca445ff
Fix deno install file name including extra dot on Windows (#4243) 2020-03-04 00:40:56 -08:00
Ryan Dahl
ce5a57667c
Disable flaky and broken tests (#4239) 2020-03-03 16:02:35 -05:00
Bartek Iwańczuk
ee452ad883
add assertOps sanitizer in cli/js/ unit tests (#4209)
* add "assertOps" test assertion which makes sure test case
  is not "leaking" ops - ie. after test finishes there are no 
  pending async ops

* apply "assertOps" to all tests in "cli/js/"

* fix numerous tests leaking ops

* document problem with edge case in "clearInterval"
   and "clearTimeout" implementation where they
   may leak async ops

* move "cli/js/worker_test.ts" to "cli/tests/worker_test.ts" and 
  run as integration test; workers leak ops because of missing
  "terminate" implementation
2020-03-03 18:22:53 +01:00