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

167 commits

Author SHA1 Message Date
Bartek Iwańczuk
527628e186
reland JsRuntime/Worker is not a Future (#7924) 2020-10-11 13:20:40 +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
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
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
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
Bartek Iwańczuk
8d00c32ee2
refactor(core): JsRuntime::poll (#7825)
This commit does reorganization of "JsRuntime::poll" to allow fixing of top-level-await bug.
2020-10-05 11:08:19 +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
454de99680
chore(core): remove experimental wasm bigint flag (#7790)
This removes the experimental bigint flag as it is enabled by default
now and is no longer necessary.
2020-10-02 11:27:18 +02:00
Ryan Dahl
ffd08a2249
Actually remove js_check (#7636) 2020-09-22 23:16:00 -04: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
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
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
Bert Belder
f5b40c918c
refactor: use the 'anyhow' crate instead of 'ErrBox' (#7476) 2020-09-15 01:50:52 +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
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
Renamed from core/core_isolate.rs (Browse further)