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

153 commits

Author SHA1 Message Date
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
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
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
dubiousjim
9a63902db5
Rename readDir -> readdir (#4225) 2020-03-06 08:34:02 -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
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
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
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
Yusuke Sakurai
4dc004f0a2
misc: reduce unnecesarry output in cli/js tests (#4182)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-03-03 15:51:07 +01:00
Bert Belder
eafd40feab
Do not convert exceptions to JSON and back (#4214) 2020-03-02 14:20:16 -08:00
Kitson Kelly
83d902a780
Fix JavaScript dependencies in bundles. (#4215)
Fixes #4602

We turned off `allowJs` by default, to keep the compiler from grabbing
a bunch of files that it wouldn't actually do anything useful with.  On
the other hand, this caused problems with bundles, where the compiler
needs to gather all the dependencies, including JavaScript ones.  This
fixes this so that when we are bundling, we analyse JavaScript imports
in the compiler.
2020-03-02 22:18:27 +01:00
dubiousjim
a3c3a56ff7
Rename Option -> Options (#4226)
* Rename MkdirOption interface to MkdirOptions

It was hard to remember which Options interfaces were spelled in the
singular and which in the plural (and anyway this one contained two
options).

Also added MkdirOptions to cli/js/deno.ts. All the analogous interfaces
were exported there.

* Rename RemoveOption interface to RemoveOptions

This was the last remaining Option interface spelled in the singular.
Easier to remember if they're all Option**s**; plus we may want to add extra
options here later.
2020-03-02 21:24:42 +01:00
Bartek Iwańczuk
ff5bba3be8
feat: update metrics to track different op types (#4221) 2020-03-02 19:13:36 +01:00
bartOssh
4a47ffa5c4
seek should return cursor position (#4211) 2020-03-02 11:44:46 -05:00
dubiousjim
6cd46fa3ef
Cleanup comments and internal variables (#4205) 2020-03-02 10:19:42 -05:00
ecyrbe
2a594bd3b2
feat(std/node): add os.tmpdir() implementation (#4213) 2020-03-01 19:05:04 -05:00
Ryan Dahl
ad21210edd
perf: use subarray instead of slice in dispatch minimal (#4180) 2020-03-01 17:17:59 -05:00
Chris Knight
b84f3efa14
docs: fix broken Deno.write() example (#4190) 2020-02-29 20:37:32 +01:00
Nayeem Rahman
1f9d158bdc
refactor(cli/js): Replace constructError() with getErrorClass() (#4189)
Flattens dispatch error handling to produce one less useless stack frame on op errors.
2020-02-29 19:04:10 +01:00
Bartek Iwańczuk
f55b22e195
add assertResources sanitizer to cli/js/ unit tests (#4161) 2020-02-29 18:45:47 +01:00
Bartek Iwańczuk
bdf95c7b72
Revert "perf: use subarray instead of slice in dispatch minimal (#4173)" (#4174)
This reverts commit 0eb91c5591.
2020-02-28 19:33:52 +01:00
Bartek Iwańczuk
0eb91c5591
perf: use subarray instead of slice in dispatch minimal (#4173) 2020-02-28 17:13:07 +01:00
Kitson Kelly
0a51611d76
Clean up lib.deno.ns.d.ts JSDoc (#4170) 2020-02-28 11:05:40 -05:00
Bartek Iwańczuk
a13b0e2727
rewrite permission revoke test as integration test (#4164) 2020-02-28 15:47:54 +01:00
Bert Belder
1cb1ab6c00
Merge mod_evaluate() and mod_evaluate_dyn_import() methods (#4167) 2020-02-27 16:30:18 -08:00
Kitson Kelly
1d26da6a47
feat: Support types compiler option in compiler APIs (#4155)
Handles `types` in the compiler APIs to make it easier to supply
external type libraries.
2020-02-27 11:27:00 -05:00
Bartek Iwańczuk
9adcdabd65
stream output of js unit tests (#4146) 2020-02-26 20:33:18 +01:00
Kitson Kelly
671f0b83be
Bundles can be sync or async based on top level await (#4124)
Previously, bundles always utilised top level await, even if the bundled
modules didn't require top level await.  Now, analysis of the bundle is
done and if none of the bundled modules are asynchronously executed,
then the bundle as a whole will be synchronously executed.

Fixes #4055
Fixes #4123
2020-02-26 17:59:33 +01:00
Bartek Iwańczuk
0e37184ca8
add window.self read-only property (#4131) 2020-02-26 11:49:38 +01:00
Kevin (Kun) "Kassimo" Qian
5946808f66
tty: Deno.setRaw(rid, mode) to turn on/off raw mode (#3958) 2020-02-26 01:01:24 -05:00
Kitson Kelly
be787d09d5
upgrade: TypeScript 3.8 (#4100) 2020-02-25 15:33:19 -05:00
Ryan Dahl
91b606aaae
Clean up how we use opIds (#4118) 2020-02-25 09:14:27 -05:00
Kitson Kelly
805992b14a
Fix issues with JavaScript importing JavaScript. (#4120)
Fixes #3852
Fixes #4117
2020-02-25 03:32:43 -05:00
Ryan Dahl
f4fd433e1a
Add Deno.Err change missing from previous commit (#4113) 2020-02-24 16:36:12 -05:00
Bartek Iwańczuk
e1687c0a46
rename Deno.Err -> Deno.errors (#4093) 2020-02-24 15:48:35 -05:00
Kitson Kelly
2b7e28b591
feat: Add Deno.formatDiagnostics (#4032) 2020-02-24 14:48:14 -05:00
ecyrbe
fb08cf7005
Add missing node os.release() implementation (#4065) 2020-02-24 08:35:45 -05:00
Kevin (Kun) "Kassimo" Qian
e9fff02e96
fetch: proper error for unsupported protocol (#4085) 2020-02-23 09:45:02 -05:00
Kevin (Kun) "Kassimo" Qian
bf48f5fa5a
Move WebAsssembly namespace to shared_globals (#4084) 2020-02-23 09:40:44 -05:00
ecyrbe
fb98556d56
feat(std/node): add os.loadavg() (#4075) 2020-02-22 18:46:52 -05:00
Bartek Iwańczuk
bd640bc7e6
feat: Deno.fsEvents() (#3452) 2020-02-21 13:21:51 -05:00
hazæ41
08686cbc3a
feat: support UDP sockets (#3946) 2020-02-21 11:26:54 -05:00
Bartek Iwańczuk
dd8a109481
refactor: remove unneeded ErrorKinds (#3936) 2020-02-21 10:36:13 -05:00
Bartek Iwańczuk
d9efb8c02a
fix: add io ops to worker to fix fetch (#4054) 2020-02-21 10:35:41 -05:00