summaryrefslogtreecommitdiff
path: root/src/ops.rs
AgeCommit message (Collapse)Author
2019-03-19Rename //src/ to //cli/ (#1962)Ryan Dahl
To better distinguish the deno_core crate from the executable deno, which will now be called "the cli" internally.
2019-03-18Re-implement init scripts in core (#1958)andy finch
Re-enables arm64 CI test
2019-03-18Remove Eager read, write, accept (#1959)Ryan Dahl
Removing this reduces tail latency in test/http_bench.ts by half.
2019-03-18Integrate //core into existing code baseRyan Dahl
This disables a few tests which are broken still: - tests/error_004_missing_module.test - tests/error_005_missing_dynamic_import.test - tests/error_006_import_ext_failure.test - repl_test test_set_timeout - repl_test test_async_op - repl_test test_set_timeout_interlaced - all of permission_prompt_test
2019-03-18More permissions prompt options (#1926)andy finch
2019-03-13--no-prompt flag for non-interactive environments (#1913)andy finch
2019-03-12Make timers act like normal opsRyan Dahl
This is in preperation for core integration.
2019-03-12Sort opsRyan Dahl
2019-03-04`use-snapshots` build option for cross compile support. (#1852)andy finch
2019-03-04Allow inspection and revocation of permissions (#1875)Simon Menke
2019-03-03Add write permissions requirement to `op_fetch_module_meta_data`. (#1874)andy finch
2019-03-01Permissions refactor (#1864)andy finch
Refactored permissions to be assignable on a per-isolate basis, and added a fix for #1858 to op_fetch_module_meta_data.
2019-02-28Use deno_core::JSError in deno (#1855)Ryan Dahl
src/js_errors.rs takes care of source maps and color while core/js_errors.rs is just the basic struct.
2019-02-18Add window.locationRyan Dahl
2019-02-18Add `seek` and implement `Seeker` on `File` (#1797)Kevin (Kun) "Kassimo" Qian
This patch contains a special hack that circumvents the current tokio seek problem. tokio `seek` is implemented to take ownership of the original File and emit a new one in its future, which conflicts with the design of ResourceTable. To avoid the problem, the current hack makes the FsFile resource an Option which we could `take` the value ownership out of it. We then convert the tokio File into a Rust std File, perform the seek, and then put it back into the resource. This might be able to drop this hack after https://github.com/tokio-rs/tokio/pull/785 lands.
2019-02-18Rationalise compiler ops (#1740)Kitson Kelly
2019-02-15Add execPath function (#1743)Dmitry Sharshakov
2019-02-15feat: env option in run api (#1773)Yoshiya Hinosawa
2019-02-09Support scoped variables, unblock REPL async op, and REPL error colors (#1721)Kevin (Kun) "Kassimo" Qian
2019-02-08Adds deno.noColor (#1716)Ryan Dahl
2019-02-08Add --allow-read (#1689)Dmitry Sharshakov
Co-authored-by: Greg Altman <g.s.altman@gmail.com>
2019-02-08fix clippy warnings (#1711)bokuweb
2019-02-02Add isTTY function (#1622)Dmitry Sharshakov
2019-02-02Compiler cleanups and minor improvements (#1656)Kitson Kelly
2019-02-02Clarify writeFile options and avoid unexpected perm modification (#1643)Kevin (Kun) "Kassimo" Qian
2019-02-02Add performance.now (#1633)Dmitry Sharshakov
2019-01-26timers: use int instead of double for timeout type (#1469)bokuweb
2019-01-17mkdir should not be recursive by default (#1530)Ryan Dahl
It should return an error if a file with the given path exists and recursive isn't specified. Because mode is not used on windows and rarely used in unix, it is made to the last parameter. In collaboration with Stefan Dombrowski <sdo451@gmail.com>
2019-01-15Clippy fixes (also fixes build with nightly) (#1527)Bert Belder
2019-01-14Update to rust 2018 editionAndy Hayden
2019-01-13Properly parse network addresses. (#1515)Ryan Dahl
2019-01-09Native ES modules (#1460)Ryan Dahl
* Native ES modules This is a major refactor of internal compiler. Before: JS and TS both were sent through the typescript compiler where their imports were parsed and handled. Both compiled to AMD JS and finally sent to V8 Now: JS is sent directly into V8. TS is sent through the typescript compiler, but tsc generates ES modules now instead of AMD. This generated JS is then dumped into V8. This should much faster for pure JS code. It may improve TS compilation speed. In the future this allows us to separate TS out of the runtime heap and into its own dedicated snapshot. This will result in a smaller runtime heap, and thus should be faster. Some tests were unfortunately disabled to ease landing this patch: 1. compiler_tests.ts which I intend to bring back in later commits. 2. Some text_encoding_test.ts tests which made the file invalid utf8. See PR for a discussion. Also worth noting that this is necessary to support WASM
2019-01-08Minimal Worker support (#1476)Ryan Dahl
This adds the ability to spawn additional Isolates from Rust and send and receive messages from them. This is preliminary work to support running the typescript compiler in a separate isolate and thus support native ES modules. Ref #975.
2019-01-06Add deno.pid (#1464)Ryan Dahl
2019-01-03Revert "use byte array instead of string for code fetch (#1307)" (#1455)Ryan Dahl
This reverts commit e976b3e0414dc768624b77e431ee7f55b03b76a4. There is nothing technically wrong with this commit, but it's adding complexity to a big refactor (native ES modules #975). Since it's not necessary and simply a philosophical preference, I will revert for now and try to bring it back later.
2019-01-02Happy new year!Ryan Dahl
2018-12-21Avoid fetch segfault on empty Uri (#1394)Kevin (Kun) "Kassimo" Qian
2018-12-14remove repeative permission checks (#1350)F001
2018-12-13Fix deno.open permission check (#1336)Kevin (Kun) "Kassimo" Qian
2018-12-12Flesh out open() modes (#1282)Bartek IwaƄczuk
2018-12-12use byte array instead of string for code fetch (#1307)F001
2018-12-12readDir entry mode (#1326)Kevin (Kun) "Kassimo" Qian
2018-12-11Minor rename for CodeFetch parametersRyan Dahl
This bring it inline with terminology used in V8 See ResolveCallback in v8.h
2018-12-11Replace blocking! macro by generic function (#1305)F001
2018-12-05Isolate::from_raw_ptr and other cleanups.F001
`Isolate::from_void_ptr` is renamed to `from_raw_ptr`, to keep consistency with std libs. It is changed to `unsafe` function, because it can't guarantee that the input is valid. This guarantee should be provided by the caller. Its return type is changed to `&Isolate`, because `&mut Isolate` type requires that no other aliases co-exist in this period of time, this does not seem true. So I changed most of the methods to accept shared reference `&Isolate`. It is easier to reason about the correctness of `unsafe` blocks. As long as these shared references are in the same thread, these `unsafe` codes are probably correct.
2018-12-04Remove static lifetime bound in OpCreator (#1276)F001
The main purpose of this PR is to remove the `'static` lifetime bound in type OpCreator = fn(state: &Arc<IsolateState>, base: &msg::Base, data: &'static mut [u8]) -> Box<Op>; The reason is simple: it is plain wrong, the `data` is actually not `'static`. It is created when the message is sent from C side, and will be recycled when the message is responded. It violates the definition of `'static` lifetime. If someone save this pointer somewhere else, and reuse it later again, uninitialized memory could be accessed. This kind of memory unsafety does not happen yet because the logic is carefully organized in this project. Lifetime constraints are maintained by code convention. It could be more robust if we can express this constraint by Rust's type system. Basic idea: tie buffer's lifetime to an object's lifetime, a.k.a, RAII. The type `deno_buf` is pretty suitable for this job.
2018-11-30clippy fixes (#1250)Andy Hayden
2018-11-29Replace mutex by atomics (#1238)F001
2018-11-28REPL unblock event loop AND fix REPL setTimeout fire problemsKevin (Kun) "Kassimo" Qian
2018-11-16First pass at running subprocesses (#1156)Bert Belder