1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-02 09:34:19 -04:00
Commit graph

322 commits

Author SHA1 Message Date
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
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
迷渡
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
迷渡
9d53a7a523
fix(doc): FileInfo.created is creation time (#4799) 2020-04-18 00:05:33 -04:00
Gudmund Vatn
260084ccbf
Add close method to Plugin (#4670) (#4785) 2020-04-17 12:51:10 +02:00
Bartek Iwańczuk
d359789c52
feat: support Deno namespace in Worker API (#4784) 2020-04-16 23:40:29 +02:00
Nayeem Rahman
5ac728a5f1
refactor(cli/js/ops/fs): Improve readdir() and FileInfo interfaces (#4763) 2020-04-16 01:40:30 -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
Bartek Iwańczuk
e08ece2d2c
fix(worker): make worker name spec compliant (#4746) 2020-04-14 17:41:06 +02: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
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
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
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
dd2d19b22d
Remove __blob and __console namespaces (#4677) 2020-04-08 13:21:04 -04:00
Ryan Dahl
fe17496831
Remove extra copy of URLSearchParams (#4675) 2020-04-08 10:32:08 -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
Ryan Dahl
51f5276e8c
Remove __textEncoding and __performanceUtil namespaces (#4663) 2020-04-07 13:27:37 -04:00
Ryan Dahl
62726430be
Remove __timers namespace (#4662) 2020-04-07 11:12:31 -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
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
dubiousjim
c5c3abc517
adjust docs for Deno.seek (#4610) 2020-04-03 13:45:44 -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
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
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
Chris Knight
1c30d755bf
better parameter names for a couple functions (#4559) 2020-04-01 12:57:33 -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
Chris Knight
e88dcdc5e1
API doc improvments (#4525) 2020-03-29 21:39:10 -04:00
Kitson Kelly
bced52505f
Update to Prettier 2 and use ES Private Fields (#4498) 2020-03-28 13:03:49 -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
Kevin (Kun) "Kassimo" Qian
5d7bcf86fd
feat: window.close() (#4474) 2020-03-24 23:56:40 -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
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
João Souto
70a5034431
feat: Support Unix Domain Sockets (#4176) 2020-03-23 18:02:51 -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
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
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
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
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
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
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