0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-31 09:14:20 -04:00
Commit graph

369 commits

Author SHA1 Message Date
Aaron O'Mullan
0260b488fb
core: introduce extensions (#9800)
Extensions allow declarative extensions to "JsRuntime" (ops, state, JS or middleware).

This allows for:
- `op_crates` to be plug-and-play & self-contained, reducing complexity leaked to consumers
- op middleware (like metrics_op) to be opt-in and for new middleware (unstable, tracing,...)
- `MainWorker` and `WebWorker` to be composable, allowing users to extend workers with their ops whilst benefiting from the other infrastructure (inspector, etc...)

In short extensions improve deno's modularity, reducing complexity and leaky abstractions for embedders and the internal codebase.
2021-04-28 18:41:50 +02:00
Casper Beyer
3a03084580
test(cli): run unit tests using Deno.test (#10330)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-04-27 13:14:01 +02:00
Aaron O'Mullan
83770e898e
fix(console): circular customInspect (#10338) 2021-04-27 11:54:47 +02:00
Bert Belder
299518d935 fix(tls): throw meaningful error when hostname is invalid (#10387)
`InvalidDNSNameError` is thrown when a string is not a valid hostname,
e.g. it contains invalid characters, or starts with a numeric digit. It
does not involve a (failed) DNS lookup.
2021-04-26 23:40:45 +02:00
Jesse Jackson
feb6af7732
fix(op_crates/fetch): Prevent throwing when inspecting a request (#10335)
Fixes: #10334
2021-04-23 20:38:45 +02:00
Aaron O'Mullan
dd156e886b
refactor(core): rename send() to opcall() (#10307)
I think it's a better fit since recv() was killed and opcall <> syscall (send/recv 
was too reminiscent of request/response and custom payloads)
2021-04-23 11:50:45 -04:00
Nayeem Rahman
8a416a5ba2
fix(runtime/js/http): cancel body on response failure (#10225) 2021-04-23 12:34:04 +02:00
Aaron O'Mullan
8d0e0ead51
fix(fetch): Response inspect regression (#10295) 2021-04-21 23:03:04 +02:00
Luca Casonato
9e6cd91014
chore: align fetch to spec (#10203)
This commit aligns the `fetch` API and the `Request` / `Response`
classes belonging to it to the spec. This commit enables all the
relevant `fetch` WPT tests. Spec compliance is now at around 90%.

Performance is essentially identical now (within 1% of 1.9.0).
2021-04-20 14:47:22 +02:00
Kitson Kelly
b6203cb465
revert: Conn type changes in #10012 and #10061 (#10255)
Fixes #10200 (again)

This reverts commit 9c7c9a35c1 and a8057e3e06.
2021-04-20 10:12:33 +10:00
Luca Casonato
fe59e7ae60
fix(rt/http): correct URL in Request (#10256)
This commit fixes the URL returned from `request.url` in the HTTP server
to be fully qualified. This previously existed, but was removed and
accidentially not readded during optimizations of the HTTP ops.

Returning a non fully qualified URL from `Request#url` is not spec
compliant.
2021-04-19 17:07:44 +02:00
Luca Casonato
0552eaf569
chore: align Headers to spec (#10199)
This commit aligns `Headers` to spec. It also removes the now unused
03_dom_iterable.js file. We now pass all relevant `Headers` WPT. We do
not implement any sort of header filtering, as we are a server side
runtime.

This is likely not the most efficient implementation of `Headers` yet.
It is however spec compliant. Once all the APIs in the `HTTP` hot loop
are correct we can start optimizing them. It is likely that this commit
reduces bench throughput temporarily.
2021-04-19 01:00:13 +02:00
Ryan Dahl
fe9cee620a
fix(#10182): hang during http server response (#10197) 2021-04-15 18:48:56 -04:00
Luca Casonato
353e79c796
chore: align FormData to spec (#10169)
This PR aligns `FormData` to spec. All WPT tests are passing.
2021-04-14 22:49:16 +02:00
crowlKats
a8057e3e06
feat(cli/dts): stricter typings for Listener & Conn (#10012) 2021-04-13 13:33:17 +02:00
Aaron O'Mullan
46b1c653c0
refactor(deno): remove concept of bin & json ops (#10145) 2021-04-12 15:55:05 -04:00
Nayeem Rahman
a20504642d
fix(runtime/js/http): Correctly parse user response headers (#10076) 2021-04-12 10:24:45 -04:00
Casper Beyer
9d53dab4df
feat(runtime): add truncate and truncateSync methods to Deno.File (#10130) 2021-04-12 14:32:58 +02:00
Casper Beyer
da9219341f
feat(runtime): add stat and statSync methods to Deno.File (#10107) 2021-04-12 13:33:05 +02:00
Nayeem Rahman
8b49d948f5
fix(runtime/js/timers): Use (0, eval) instead of eval() (#10103) 2021-04-12 01:40:42 +02:00
Liam Murphy
3c645457a4
fix(op_crates/console): console.table value misalignment with varying keys (#10127) 2021-04-11 14:19:50 +02:00
Bartek Iwańczuk
1c7217e390
chore: upgrade dependencies (#10094)
This commit upgrades:
- swc_ecmascript
- swc_bundler
- deno_doc
- deno_lint
- dprint-plugin-typescript
2021-04-09 23:35:29 +02:00
Nayeem Rahman
c86ee742a2
fix: async op error stacktraces (#10080)
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
2021-04-09 11:55:33 -04:00
Ryan Dahl
c6e7a243d5
API change: Deno.startHttp -> Deno.serveHttp (#10087) 2021-04-09 11:54:27 -04:00
Bartek Iwańczuk
70af812876
feat: native HTTP bindings (#9935)
Co-authered-by: Luca Casonato <lucacasonato@yahoo.com>
Co-authered-by: Ben Noordhuis <info@bnoordhuis.nl>
Co-authered-by: Ryan Dahl <ry@tinyclouds.org>
2021-04-08 18:34:15 -04:00
Inteon
d050b491b1
fix(core): error handling in examples (#9867) 2021-04-08 18:04:02 +02:00
Satya Rohith
543080de55
fix(runtime/readFile*): close resources on error during read (#10059)
This commit ensures readFile, readFileSync, readTextFile,
and readTextFileSync does not leak resources on error.
2021-04-08 16:36:52 +02:00
Luca Casonato
da60e2afcb
chore: deprecate Deno.Buffer and read/write utils (#9793)
This commit marks the `Deno.Buffer` / `Deno.readAll` /
`Deno.readAllSync` / `Deno.writeAll` / `Deno.writeAllSync` utils as
deprecated, and schedules them for removal in Deno 2.0. These
utilities are implemented in pure JS, so should not be part of the
Deno namespace.

These utilities are now available in std/io/buffer and std/io/util:
https://github.com/denoland/deno_std/pull/808.

This additionallty removes all internal dependance on Deno.Buffer.
2021-04-06 00:05:36 +02:00
Luca Casonato
284e6c3039
chore: update std submodule (#10017) 2021-04-05 15:57:52 +02:00
Aaron O'Mullan
fec1b2a5a4
refactor: new optimized op-layer using serde_v8 (#9843)
- Improves op performance.
- Handle op-metadata (errors, promise IDs) explicitly in the op-layer vs
  per op-encoding (aka: out-of-payload).
- Remove shared queue & custom "asyncHandlers", all async values are
  returned in batches via js_recv_cb.
- The op-layer should be thought of as simple function calls with little
  indirection or translation besides the conceptually straightforward
  serde_v8 bijections.
- Preserve concepts of json/bin/min as semantic groups of their
  inputs/outputs instead of their op-encoding strategy, preserving these
  groups will also facilitate partial transitions over to v8 Fast API for the
  "min" and "bin" groups
2021-03-31 10:37:38 -04:00
Inteon
1251c89321
refactor: Move bin ops to deno_core and unify logic with json ops (#9457)
This commit moves implementation of bin ops to "deno_core" crates
as well as unifying logic between bin ops and json ops to reuse
as much code as possible (both in Rust and JavaScript).
2021-03-20 17:51:08 +01:00
Aaron O'Mullan
7d12dd1899
fix: fallback to default UA and CA data for Deno.createHttpClient() (#9830) 2021-03-18 23:54:26 +01:00
Luca Casonato
62716422b9
chore(console): distinguish between log levels (#9824)
Change `Console.#printFunc` to pass a log level as the second argument
(0 = debug, 3 = error), instead of a boolean for `isErr`. This does not
change the Deno runtime behaviour at all.
2021-03-18 19:25:25 +01:00
Inteon
20627c9136
refactor: update minimal ops & rename to buffer ops (#9719)
This commit rewrites "dispatch_minimal" into "dispatch_buffer".

It's part of an effort to unify JS interface for ops for both json
and minimal (buffer) ops.

Before this commit "minimal ops" could be either sync or async
depending on the return type from the op, but this commit changes
it to have separate signatures for sync and async ops (just like 
in case of json ops).
2021-03-18 14:10:27 +01:00
crowlKats
0e70d9e59b
refactor: clean up permission handling (#9367) 2021-03-17 17:45:12 -04:00
Luca Casonato
0770449c93
refactor: move Console to op_crates/console (#9770) 2021-03-12 21:23:59 +01:00
Nayeem Rahman
0bc488c85c
fix(runtime/js): add navigator interface objects (#9685) 2021-03-08 13:27:49 +01:00
Bert Belder
1f47bdd69d
test(op_crates/web): add regression tests for past URL bugs (#9639) (#9639)
Closes: #9383
2021-03-02 19:09:58 +01:00
Bartek Iwańczuk
faf2e80272
chore: upgrade crates (#9632) 2021-03-02 13:39:56 +01:00
Nayeem Rahman
badc88b78a
refactor(op_crates/web): Move URL parsing to Rust (#9276) 2021-03-02 02:30:24 +01:00
crowlKats
7cd14f97c9
feat: WebGPU API (#7977)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-03-01 11:31:13 +01:00
Casper Beyer
687ff2ab14
fix(runtime): do not panic on irregular dir entries (#9579) 2021-02-25 05:16:18 -05:00
Kitson Kelly
d7837c8eb5
feat(cli): update to TypeScript 4.2 (#9341) 2021-02-25 15:16:19 +11:00
Kitson Kelly
097e9c44f4
feat(runtime): stabilise permissions and add event target capabilities (#9573) 2021-02-25 14:33:09 +11:00
Kohei Ueno
2e3d72064a
fix: panic caused by Deno.env.set("", "") (#9583) 2021-02-23 04:24:59 -05:00
David DeSimone
8be0c8b43a
fix(tests): fix fetchConnectionError test if port is in use (#9465)
Fixes #9379
2021-02-22 13:26:17 +01:00
Luca Casonato
9d70ea2e9f
feat(unstable): per op metrics (#9240) 2021-02-21 19:20:31 +01:00
Casper Beyer
3f5265b21e
fix: align btoa to spec (#9053) 2021-02-16 02:10:59 +01:00
Bartek Iwańczuk
8c6d147e6a
chore: Reorganise workers tests (#9493) 2021-02-15 14:48:47 +01:00
Jared Beller
b50691efed
refactor(core): Strongly typed deserialization of JSON ops (#9423)
This PR makes json_op_sync/async generic to all Deserialize/Serialize types
instead of the loosely-typed serde_json::Value. Since serde_json::Value
implements Deserialize/Serialize, very little existing code needs to be updated,
however as json_op_sync/async are now generic, type inference is broken in some
cases (see cli/build.rs:146). I've found this reduces a good bit of boilerplate,
as seen in the updated deno_core examples.

This change may also reduce serialization and deserialization overhead as serde
has a better idea of what types it is working with. I am currently working on
benchmarks to confirm this and I will update this PR with my findings.
2021-02-13 11:56:56 -05:00
Luca Casonato
af460fc464
fix: webidl utils and align Event to spec (#9470) 2021-02-13 15:58:12 +01:00
Erik Price
a097c4089b
fix(runtime/tls): handle invalid host for connectTls/startTls (#9453) 2021-02-11 12:45:10 +01:00
David DeSimone
61108935f1
fix(console): log function object properties / do not log non-enumerable props by default (#9363) 2021-02-10 20:52:54 +09: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
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
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
Luca Casonato
6ecc86cf2a
chore: add jsdoc to 26_fetch.js and enable some fetch tests (#9305) 2021-01-28 21:37:21 +01:00
Luca Casonato
e0eb111e3e
Revert "tests: enable wpt for url (#9046)" (#9264)
This reverts commit 66e99d349b.
2021-01-25 16:02:03 +01: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
Bert Belder
b0132e8f90
fix(cli): actually stabilize Deno.shutdown() (#9181) 2021-01-19 20:11:08 -08:00
Kitson Kelly
2077864a8d
fix(op_crate/fetch): add back ReadableStream.getIterator and deprecate (#9146) 2021-01-18 10:40:39 +11:00
Bartek Iwańczuk
b26dcbc69d
chore: Enforce ban-untagged-todo lint rule (#9135) 2021-01-17 00:32:59 +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
Yusuke Tanaka
d8fd71afdf
chore: update copyright to 2021 (#9092) 2021-01-11 18:13:41 +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
9637209765
fix(web): implement DOMException#code (#9015)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-01-09 07:27:46 +01:00
Nayeem Rahman
e61e81eb57
feat: add --location=<href> and globalThis.location (#7369) 2021-01-07 19:06:08 +01:00
Anonymous
3761d054d0
fix: stronger input checking for setTimeout; add function overload (#8957) 2021-01-06 08:53:30 -05:00
Luca Casonato
0d41e21b0e
fix: align encoding APIs to spec using WPT (#9004) 2021-01-05 19:50:40 +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
Bartek Iwańczuk
f4246ee1fc
chore: disable flaky test on Windows (#8987) 2021-01-04 14:27:29 +01: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
Yosi Pramajaya
c1fdb30394
fix: fetch bad URL will not panic (#8884) 2020-12-26 08:06:00 -05:00
Luca Casonato
ddda669a02
fix: implement ReadableStream fetch body handling (#8855) 2020-12-22 14:14:23 +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
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
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
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
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
Jae-Heon Ji
d492fb0eac
fix(op_crates/fetch): support non-ascii response headers value (#8600) 2020-12-09 16:48:06 +01:00
William Perron
a16adca06b
test(cli): fix brittle network permission test (#8526) 2020-11-27 21:02:25 +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
crowlKats
e6685f0f01
refactor(cli/tests): replace createResolvable with deferred (#8507) 2020-11-26 17:22:36 +01:00
crowlKats
d40b0711a7
fix(websocket): Fix PermissionDenied error being caught in constructor (#8402) 2020-11-25 15:17:46 +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
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
Benjamin Gruenbaum
a55e689e38
fix(op_crates/web): FileReader event handler order (#8348) 2020-11-11 16:59:49 +01: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
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
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
Ross Weir
60cd7695ef
fix(cli): handle URL paths in Deno.mkdir() (#8140) 2020-10-27 13:21:32 +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
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
aca
9cf06f76fd
fix(op_crates/web): TextEncoder should return error message with original input (#8005) 2020-10-20 13:47:38 +02: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
Luca Casonato
08441b855d
fix(op_crates/fetch): Body.body should be stream of Uint8Array (#8030) 2020-10-19 17:01:36 +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
Yoshiya Hinosawa
e9f02c2314
fix(console): fix the test cases of function inspections (#7965) 2020-10-14 15:01:03 +02: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
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
Lively
782e6a2ed5
fix(op_crate/web): add padding on URLSearchParam (#7905)
Fixes #7888
2020-10-10 16:20:24 +11:00
Nayeem Rahman
98727b331d
fix(op_crates/fetch): Stringify and parse Request URLs (#7838)
Fixes #7837
2020-10-09 16:12:44 +11: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
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
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
Nayeem Rahman
72425810b8
perf(cli/console): Don't add redundant ANSI codes (#7823) 2020-10-05 11:50:49 +02:00
Trivikram Kamat
d0eb179132
docs: end sentences with a period in markdown (#7813) 2020-10-04 07:19:11 +11:00
Bartek Iwańczuk
e5348a6a38
upgrade: swc, deno_doc, deno_lint, dprint (#7793) 2020-10-02 13:51:37 +02:00
Nayeem Rahman
b689e60b60
fix(cli/console): Catch and format getter errors (#7766) 2020-10-01 11:25:34 +02: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
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
Bartek Iwańczuk
b6c189e88e
refactor: clean timers tests (#7679) 2020-09-25 18:34:20 +02:00
Kitson Kelly
fd1c913985
fix(cli): customInspect works on functions (#7670)
Fixes #7650
2020-09-25 21:36:26 +10: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
Casper Beyer
a33315aaa7
fix(cli/console): quote object symbol keys that are invalid identifiers (#7553) 2020-09-22 11:10:02 -04:00
Luca Casonato
5c2e499c3a
fix: Response.arrayBuffer() doesn't return promise (#7618) 2020-09-21 22:07:41 +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
93e8e59a7e
fix(cli/console): surround non alpha-numeric object keys with quotes (#7550) 2020-09-18 11:25:09 -04: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
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
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
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
Nayeem Rahman
f874b83aa0
test(cli/tests/unit): Enable color for js_unit_tests (#7443) 2020-09-14 12:46:50 +02:00
Kitson Kelly
10fbfcbc79
refactor: improve tsc diagnostics (#7420) 2020-09-12 11:53:57 +02: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