Bartek Iwańczuk
c2b91a3ef6
Flesh out open() modes ( #1282 )
2018-12-12 12:05:58 -05:00
F001
e976b3e041
use byte array instead of string for code fetch ( #1307 )
2018-12-12 04:43:42 -05:00
Kevin (Kun) "Kassimo" Qian
585de35b1d
readDir entry mode ( #1326 )
2018-12-12 02:31:18 -05:00
Ryan Dahl
52079b26db
Minor rename for CodeFetch parameters
...
This bring it inline with terminology used in V8
See ResolveCallback in v8.h
2018-12-11 15:06:56 -05:00
F001
c1de50b0ca
Replace blocking! macro by generic function ( #1305 )
2018-12-11 08:36:34 -05:00
F001
60c008d23b
Isolate::from_raw_ptr and other cleanups.
...
`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-05 00:14:53 -08:00
F001
30420ad317
Remove static lifetime bound in OpCreator ( #1276 )
...
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-12-04 13:21:02 -08:00
Andy Hayden
aab02805dd
clippy fixes ( #1250 )
2018-11-30 00:30:49 -08:00
F001
b6fda735ee
Replace mutex by atomics ( #1238 )
2018-11-29 19:03:00 -08:00
Kevin (Kun) "Kassimo" Qian
09aa9b9698
REPL unblock event loop AND fix REPL setTimeout fire problems
2018-11-28 15:25:30 -08:00
Bert Belder
48bf4062e4
First pass at running subprocesses ( #1156 )
2018-11-16 12:07:40 +08:00
Ryan Dahl
eaec5a8780
Support uploading data from fetch()
...
Does not yet support streaming, only strings and TypedArrays for now.
2018-11-16 11:44:25 +08:00
Ryan Dahl
3c8d2bde68
Support request method and headers in fetch() ( #1188 )
...
Adds a general HttpHeader flatbuffer message for serializing requests
and responses.
2018-11-14 17:36:34 -08:00
Ryan Dahl
b1579460ce
Support streaming response bodies from fetch()
...
Also Buffer.readFrom in fetch() to buffer response.
2018-11-13 21:44:38 -08:00
Andy Hayden
13e1eb2b87
Fix many of the clippy::pedantic warnings
2018-11-06 06:43:02 -08:00
Andy Hayden
27ecfc1617
Add repl ( #998 )
...
- Running repl from js side.
- Add tests for repl behavior.
- Handle ctrl-C and ctrl-D.
2018-11-05 09:55:59 -08:00
Andy Hayden
1241b8e9ba
Fix clippy warnings ( #1149 )
...
Run with: cargo clippy
https://github.com/rust-lang-nursery/rust-clippy
2018-11-04 06:04:24 -08:00
Ryan Dahl
ee24254bad
Rename EnvPair to KeyValue.
2018-11-02 20:50:01 -07:00
Ryan Dahl
80b5c61460
Rename FetchReq op to Fetch.
2018-10-30 17:42:19 -07:00
Bartek Iwańczuk
946acbc559
Add resources op ( #1119 )
2018-10-30 12:58:55 -07:00
Kitson Kelly
8b39d2c99e
Separate source map from output code.
2018-10-29 08:16:35 -07:00
Ryan Dahl
6adc87e3eb
Ergonomics: Prompt TTY for permission escalation ( #1081 )
2018-10-27 06:11:39 -07:00
Kevin (Kun) "Kassimo" Qian
a99aaf5def
Add chmod/chmodSync on unix (and fix Cargo.toml) ( #1088 )
...
Initial implementation by Srijan Reddy (@srijanreddy98, #672 ).
2018-10-26 13:01:45 -07:00
Ryan Dahl
9b8f77f525
Support https in fetch.
...
fetch should use same hyper connector as import.
2018-10-26 09:40:27 -07:00
Kitson Kelly
8ef7da2611
Enforce media types
2018-10-23 04:48:00 -07:00
Ryan Dahl
92b0a94c23
Optimization: eager accept
2018-10-20 12:39:56 -07:00
Ryan Dahl
aac9e204b7
Optimization: eager write
2018-10-20 12:39:56 -07:00
Ryan Dahl
2c33334d28
Optimization: eager read
...
TCP sockets should attempt the non-blocking read in the main thread.
2018-10-20 12:39:56 -07:00
Ryan Dahl
2af25b1957
Allow partial writes.
...
Do not use tokio_io::io:write_all().
Adds src/tokio_write.rs
2018-10-20 12:39:56 -07:00
Ryan Dahl
8f9d407e22
Sort ops.
2018-10-19 21:36:07 -04:00
ztplz
b809a82fd9
Add missing copyrights ( #1024 )
2018-10-19 15:25:29 -04:00
Ryan Dahl
213885a9d0
Optimization: Reuse ArrayBuffer during serialization.
2018-10-17 20:20:06 -04:00
Jinho Bang
32f0797128
Fix a bug that copyFile reports different error codes
...
This is a workaroud. Once the issue is resolved in Rust side, we should
remove it.
Fixes #895
2018-10-17 08:24:31 -04:00
Ryan Dahl
590feb1c71
Format
2018-10-16 09:37:38 -04:00
Jinho Bang
1322f3de9f
deno -v
should report typescript version
...
Fixes #993
2018-10-15 22:16:55 -04:00
Shiva Prasanth
bbf88c5295
Add cwd() and chdir() ( #907 )
2018-10-13 16:03:27 -04:00
Kitson Kelly
298d755152
Add support for --types
2018-10-11 20:29:43 -04:00
Bartek Iwańczuk
51f9331ecb
Add deno.metrics()
2018-10-11 15:45:51 -04:00
J2P
7cc9b64ff7
Rename BadFileDescriptor
2018-10-10 12:21:01 -04:00
Yoshiya Hinosawa
48923f48a2
docs: fix urls in comments
2018-10-06 23:26:39 -04:00
Kevin (Kun) "Kassimo" Qian
62a5020602
Fix symlink error message
2018-10-06 20:24:47 -04:00
Kevin (Kun) "Kassimo" Qian
1ac80feb1c
Replace panic with error on windows for symlink
2018-10-05 21:20:34 -04:00
Ryan Dahl
c3bce178b8
Clean up helpers in src/errors.rs
...
* Add errors::bad_resource()
* Move permission_denied() to errors.rs
* Make op_symlink's not_implemented() into a runtime panic.
2018-10-05 14:27:47 -04:00
Kevin (Kun) "Kassimo" Qian
941e27d8c1
Implement closeRead/closeWrite using TcpStream::shutdown ( #903 )
2018-10-05 12:16:23 -04:00
Ryan Dahl
2f44db6756
Use underscores in filenames.
2018-10-04 00:25:55 -04:00
Ryan Dahl
f774953011
Rename flatbuffer base.msg to base.inner
...
This better disambiguates with the msg_generated.ts module, which in JS
we call "fbs", but would be better called "msg".
2018-10-04 00:25:55 -04:00
Ryan Dahl
51dc46eff4
Rename msg_from_js() to dispatch().
2018-10-04 00:25:55 -04:00
Ryan Dahl
d38c4e0ff1
Rename handler.rs to ops.rs
2018-10-04 00:25:55 -04:00