summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2018-12-12Change default to false Base.boolTnarita0000
2018-12-12js_errors: rename source_url to script_name (#1329)ggtmtmgg
2018-12-12use byte array instead of string for code fetch (#1307)F001
2018-12-12Simplify src fetch logic and auto append suffix in cache search (#1322)Kevin (Kun) "Kassimo" Qian
2018-12-12readDir entry mode (#1326)Kevin (Kun) "Kassimo" Qian
2018-12-11Remove custom panic handler.Ryan Dahl
This was introduced because Tokio would swallow panics. This is still the case, but this panic handler causes more problems than it solves. It requires people to know how to use debuggers to inspect stacktraces. TODO: - Fix Tokio to not swallow errors. - Be vigilant in the intrim to not introduce broken tests due to this unfortunate "feature" of tokio.
2018-12-11Use default filename for Isolate::execute.Ryan Dahl
2018-12-11Remove dead code: ASSET_PREFIXRyan Dahl
2018-12-11deno_dir: move tests into submoduleRyan Dahl
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-10Use stderr for exceptions (#1303)Ryan Dahl
2018-12-09Add TooLarge error code for buffers (#1298)binaryta
In collaboration with @yushimatenjin
2018-12-07v0.2.2Ryan Dahl
- Don't crash when .mime file not exist in cache (#1291) - Process source maps in Rust instead of JS (#1280) - Use alternate TextEncoder/TextDecoder implementation (#1281) - Upgrade flatbuffers to 80d148 - Fix memory leaks (#1265, #1275)
2018-12-07Don't crash when .mime file not exist in cache (#1291)Kevin (Kun) "Kassimo" Qian
2018-12-06Process source maps in Rust instead of JS (#1280)Ryan Dahl
- Improves speed and binary size significantly. - Makes deno_last_exception() output a JSON structure. - Isolate::execute and Isolate::event_loop now return structured, mapped JSError objects on errors. - Removes libdeno functions: libdeno.setGlobalErrorHandler() libdeno.setPromiseRejectHandler() libdeno.setPromiseErrorExaminer() In collaboration with Ryan Dahl.
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-04Add deno_config struct for isolate creation. (#1277)Ryan Dahl
In preperation for adding other callbacks to libdeno.
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-12-03Avoid memory leak (#1265)F001
2018-12-03Use include_bytes! instead of incbin.Ryan Dahl
This is the second attempt at this patch. The first version was reverted in 2ffd78daf9956a24098d1f959f21882e350e9d37 The problem, I suspect, was that the snapshot was represented as a source_set, which inserted a node into the dependency tree. include_bytes does properly insert the snapshot into rustc's depfile but the use of source_set confused gn. Now the that the deno executable has the create_deno_snapshot as a direct dependency, changes will be propagated.
2018-11-30v0.2.1Ryan Dahl
- Allow async functions in REPL (#1233) - Handle Location header relative URI (#1240) - Add deno.readAll() (#1234) - Add Process.output (#1235) - Upgrade to TypeScript 3.2.1 - Upgrade crates: tokio 0.1.13, hyper 0.12.16, ring 0.13.5
2018-11-30clippy fixes (#1250)Andy Hayden
2018-11-29Replace mutex by atomics (#1238)F001
2018-11-29Handle Location header relative URI (#1240)Kevin (Kun) "Kassimo" Qian
2018-11-28REPL unblock event loop AND fix REPL setTimeout fire problemsKevin (Kun) "Kassimo" Qian
2018-11-27Don't use snapshot for src/isolate.rs tests.Ryan Dahl
2018-11-23Revert "Use include_bytes! instead of incbin. (#1182)"Ryan Dahl
Reverting because this is causing Appveyor to be red. However I hope we can reintroduce include_bytes! soon in a way that works on windows. Fixes #1208. This reverts commits 96c3641fffe8509af9351cec4580861e76d89cc9 and 92e404706b0b1a26cdaf6f8cf81aac148292557f.
2018-11-16v0.2.0Ryan Dahl
Changes since v0.1.12: - First pass at running subprocesses (#1156) - Improve flag parsing (#1200) - Improve fetch() (#1194 #1188 #1102) - Support shebang (#1197)
2018-11-16First pass at running subprocesses (#1156)Bert Belder
2018-11-16improve flag parsingBartek IwaƄczuk
2018-11-16Support uploading data from fetch()Ryan Dahl
Does not yet support streaming, only strings and TypedArrays for now.
2018-11-16Lift snapshot to be an argument of Isolate::new().Ryan Dahl
2018-11-16Support shebangRyan Dahl
2018-11-16Simplify NotFound code.Ryan Dahl
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-13Wrapper around hyper::Body so it can be used as AsyncReadRyan Dahl
2018-11-12Use include_bytes! instead of incbin. (#1182)Ryan Dahl
2018-11-12v0.1.12Ryan Dahl
- Update to TypeScript 3.1.6 (#1177) - Fixes Headers type not available. (#1175) - Reader/Writer to use Uint8Array not ArrayBufferView (#1171) - Fixes importing modules starting with 'http'. (#1167) - build: Use target/ instead of out/ (#1153) - Support repl multiline input (#1165)
2018-11-08Local filenames starting with 'http' shouldn't be remote. (#1167)Ryan Dahl
2018-11-06Fix many of the clippy::pedantic warningsAndy Hayden
2018-11-06Remove flags::processAndy Hayden
It was doing two independent things: - print help and exit - set log level It's better to do those explicitly in main.rs
2018-11-05v0.1.11Ryan Dahl
- Performance and stability improvements on all platforms. - Add repl (#998) - Add deno.Buffer (#1121) - Support cargo check (#1128) - Upgrade Rust crates and Flatbuffers. (#1145, #1127) - Add helper to turn deno.Reader into async iterator (#1130) - Add ability to load JSON as modules (#1065) - Add deno.resources() (#1119) - Add application/x-typescript mime type support (#1111)
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-03third_party: add tokio-process Rust crate and its dependenciesBert Belder
2018-11-02Rename EnvPair to KeyValue.Ryan Dahl
2018-11-01cargo: build in Cargo's out dir if DENO_BUILD_PATH is not setBert Belder
Plus some minor improvements and clean-ups: * Resolve DENO_BUILD_PATH to an absolute path if necessary. * Rename DENO_BUILD_PATH to GN_OUT_DIR in places where it is supposed to be set by the build system (and not a user configuration variable). * Output Cargo `rerun-if-*-changed` instructions first, so even if the build itself fails, configuration changes will still trigger a re-run of build.rs. * Remove TODOs that are impossible. * Re-run build.rs when the flatbuffer definition file changes.
2018-10-31Support cargo check (#1128)Ryan Dahl
- Based on code from @qti3e and @piscisaureus in #724 and #1125 respectively. - TODO The DENO_BUILD_PATH env var must be supplied and must be an absolute path, this restriction should be removed in future work.