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

24 commits

Author SHA1 Message Date
Nayeem Rahman
e61e81eb57
feat: add --location=<href> and globalThis.location (#7369) 2021-01-07 19:06:08 +01:00
Nayeem Rahman
b5f1d257a3
fix: Use "none" instead of false to sandbox Workers (#9034) 2021-01-07 05:52:30 -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
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
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
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
crowlKats
e6685f0f01
refactor(cli/tests): replace createResolvable with deferred (#8507) 2020-11-26 17:22:36 +01:00
Kitson Kelly
276f529755
feat(cli): update to TypeScript 4.1 (#7573) 2020-11-24 09:31:10 +11:00
Benjamin Gruenbaum
b255a05f18
fix(web/worker) define event handlers in DOM order (#8334) 2020-11-10 07:15:42 -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
Nayeem Rahman
5f3028af13
fix(cli/rt/main): Add global interface objects (#7875) 2020-10-12 09:04:43 +11:00
David Sherret
cde4dbb351
Use dprint for internal formatting (#6682) 2020-07-14 15:24:17 -04:00
Nayeem Rahman
44251ce8ea
fix(cli/js/web/worker): Disable relative module specifiers (#5266) 2020-06-09 14:33:52 +02:00
Oliver Lenehan
a08a4abac1
feat(workers): "crypto" global accessible in Worker scope (#5121) 2020-05-08 14:30:53 +02:00
Bartek Iwańczuk
d359789c52
feat: support Deno namespace in Worker API (#4784) 2020-04-16 23:40:29 +02:00
Bartek Iwańczuk
e08ece2d2c
fix(worker): make worker name spec compliant (#4746) 2020-04-14 17:41: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
Bartek Iwańczuk
be71885628
implement Worker.terminate() and self.close() (#4684) 2020-04-10 00:15:17 +02:00
Kitson Kelly
bced52505f
Update to Prettier 2 and use ES Private Fields (#4498) 2020-03-28 13:03:49 -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
Bartek Iwańczuk
b8fa3fd5e7
move compiler API tests to integration tests (#4319) 2020-03-11 21:54:53 +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
Renamed from cli/js/workers_test.ts (Browse further)