summaryrefslogtreecommitdiff
path: root/src/ops.rs
AgeCommit message (Collapse)Author
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
2018-11-16Support uploading data from fetch()Ryan Dahl
Does not yet support streaming, only strings and TypedArrays for now.
2018-11-14Support request method and headers in fetch() (#1188)Ryan Dahl
Adds a general HttpHeader flatbuffer message for serializing requests and responses.
2018-11-13Support streaming response bodies from fetch()Ryan Dahl
Also Buffer.readFrom in fetch() to buffer response.
2018-11-06Fix many of the clippy::pedantic warningsAndy Hayden
2018-11-05Add repl (#998)Andy Hayden
- Running repl from js side. - Add tests for repl behavior. - Handle ctrl-C and ctrl-D.
2018-11-04Fix clippy warnings (#1149)Andy Hayden
Run with: cargo clippy https://github.com/rust-lang-nursery/rust-clippy
2018-11-02Rename EnvPair to KeyValue.Ryan Dahl
2018-10-30Rename FetchReq op to Fetch.Ryan Dahl
2018-10-30Add resources op (#1119)Bartek Iwańczuk
2018-10-29Separate source map from output code.Kitson Kelly
2018-10-27Ergonomics: Prompt TTY for permission escalation (#1081)Ryan Dahl
2018-10-26Add chmod/chmodSync on unix (and fix Cargo.toml) (#1088)Kevin (Kun) "Kassimo" Qian
Initial implementation by Srijan Reddy (@srijanreddy98, #672).
2018-10-26Support https in fetch.Ryan Dahl
fetch should use same hyper connector as import.
2018-10-23Enforce media typesKitson Kelly
2018-10-20Optimization: eager acceptRyan Dahl
2018-10-20Optimization: eager writeRyan Dahl
2018-10-20Optimization: eager readRyan Dahl
TCP sockets should attempt the non-blocking read in the main thread.
2018-10-20Allow partial writes.Ryan Dahl
Do not use tokio_io::io:write_all(). Adds src/tokio_write.rs
2018-10-19Sort ops.Ryan Dahl
2018-10-19Add missing copyrights (#1024)ztplz
2018-10-17Optimization: Reuse ArrayBuffer during serialization.Ryan Dahl
2018-10-17Fix a bug that copyFile reports different error codesJinho Bang
This is a workaroud. Once the issue is resolved in Rust side, we should remove it. Fixes #895
2018-10-16FormatRyan Dahl
2018-10-15`deno -v` should report typescript versionJinho Bang
Fixes #993
2018-10-13Add cwd() and chdir() (#907)Shiva Prasanth
2018-10-11Add support for --typesKitson Kelly
2018-10-11Add deno.metrics()Bartek Iwańczuk
2018-10-10Rename BadFileDescriptorJ2P