1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-01 16:51:13 -05:00
Commit graph

208 commits

Author SHA1 Message Date
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
0422b224e8
First pass at support for TCP servers and clients. (#884)
Adds deno.listen(), deno.dial(), deno.Listener and deno.Conn.
2018-10-03 23:58:29 -04:00
Kevin (Kun) "Kassimo" Qian
3c080ca39a
Reenable copyFile tests 2018-10-03 16:22:32 -07:00
Andy Hayden
47508c7207
Update timer test to use #497 test case
This behavior was fixed by #885.
2018-10-03 16:05:00 -07:00
J2P
ea87034e26 Implemented readDirSync, readDir 2018-10-03 18:22:57 -04:00
Ryan Dahl
d39055d79b Clean up deno.platform
Renames:
deno.platform -> deno.platform.os
deno.arch -> deno.platform.arch

Removes unsupported operating systems and CPU architectures from the
types. Uses the string "win" instead of "win32".
2018-10-03 16:59:00 -04:00
Ryan Dahl
0cdf1f451d Rename tsconfig.generated.json to tsconfig.declarations.json 2018-10-03 16:59:00 -04:00
Bert Belder
6cfc6b5d51
test: disable incorrect tests
These tests weren't running because with the old timer implementation
time-outs were sometimes lost, and the test harness uses setTimeout
to throw errors after a test has failed.
2018-10-03 13:28:00 -07:00
Li Hao
99e2c42d16
timers: add some more unit tests
Closes #682.
2018-10-03 13:27:59 -07:00
Bert Belder
aa691ea26c
timers: implement timers in javascript 2018-10-03 13:27:55 -07:00
Ryan Dahl
42c5b103ec Rename FdTable to ResourceTable.
Add docs to src/resources.rs.
2018-10-01 22:30:57 -04:00
Ryan Dahl
393f751a27 Format. 2018-10-01 22:30:57 -04:00
Kevin (Kun) "Kassimo" Qian
3a6d4e6260 Bind this to console methods (#873)
Fixes #872
2018-10-01 12:41:37 -04:00
Yingbo (Max) Wang
bcdbfc00f0 Limit depth of output in console.log for nested objects, and add console.dir (#826) 2018-09-30 18:10:20 -04:00
Kevin (Kun) "Kassimo" Qian
50a9c2b575 Add copyFile/copyFileSync (#863) 2018-09-30 18:06:41 -04:00
Ryan Dahl
cec82263c1 Format 2018-09-30 16:35:12 -04:00
ztplz
062b22fe56 Add deno.truncate (#805) 2018-09-30 15:06:20 -04:00
ztplz
b635553fd7 Improve fetch headers (#853) 2018-09-30 10:31:50 -04:00
Ryan Dahl
bcbbee7399 Adds basic File I/O and FD table.
Adds deno.stdin, deno.stdout, deno.stderr, deno.open(), deno.write(),
deno.read(), deno.Reader, deno.Writer, deno.copy().

Fixes #721. tests/cat.ts works.
2018-09-28 20:53:33 -04:00
Ryan Dahl
b1d9014b5b Print 'Compiling' when compiling TS. 2018-09-27 17:34:51 -04:00
Ryan Dahl
d38ccfc6dc
Support zero-copy data in libdeno.send(). (#838)
This is a large API refactor of deno.h which replaces
deno_send() and deno_set_response() with deno_respond().
It also adds a req_id parameter to the deno_recv_cb.

Make writeFile/writeFileSync use it.
2018-09-27 17:33:10 -04:00
Kevin (Kun) "Kassimo" Qian
1e390e69cd Error pretty print (print stack) 2018-09-26 19:30:43 -04:00
Ryan Dahl
b088b58f76 Add SetGlobalTimeout().
To be used for a timers implementation soon.
2018-09-25 17:02:49 -04:00
Ryan Dahl
4fd2b19f64 Make Deno multithreaded.
By using the tokio default runtime.

This patch makes all of the ops thread safe.

Adds libdeno to JS globals to make for easier testing.

Preliminary work for #733.
2018-09-25 17:02:49 -04:00
Ryan Dahl
7fb2821937 format 2018-09-25 17:02:49 -04:00
J2P
3c24b9f724 Fix trace test code 2018-09-25 12:47:13 -04:00
Kevin (Kun) "Kassimo" Qian
f156a86024 console.warn goes to stderr (#810) 2018-09-25 01:27:02 -04:00
Mani Maghsoudlou
ad5065e23e Implement deno.readlink() (#797) 2018-09-25 00:20:49 -04:00
Kevin (Kun) "Kassimo" Qian
be8f49b332 Add toString for CallSite of eval origin (#809) 2018-09-24 15:42:09 -04:00
Bartek Iwańczuk
3fe4be07ca Add flag --recompile (#801) 2018-09-24 15:33:50 -04:00
Yoshiya Hinosawa
17a7b03d1b Start testing website (#813) 2018-09-24 11:31:14 -04:00
Kevin (Kun) "Kassimo" Qian
c124db4701 [console] Use constructor.name to print out function type (#664) 2018-09-24 10:06:48 -04:00
ztplz
f3684c28e5 Rename deno.argv, libdeno::DenoC and deno_set_flags (#796) 2018-09-22 08:47:44 -04:00
Kevin (Kun) "Kassimo" Qian
7a0670a951 Implement deno.trace() (#795) 2018-09-22 03:59:26 -04:00
Kevin (Kun) "Kassimo" Qian
4d16d54ff8 Add atob() and btoa() (#776) 2018-09-20 18:53:29 -04:00
Kevin (Kun) "Kassimo" Qian
fab4bdf40d Add deno.arch/deno.platform (#773) 2018-09-20 02:13:59 -04:00
Mani Maghsoudlou
017ef096df Implement deno.symlink() (#742) 2018-09-18 21:38:24 -07:00
Bert Belder
7553bcb74f
format 2018-09-17 22:54:39 -07:00
Kevin (Kun) "Kassimo" Qian
e3d634eb21 Make mode always u32 and switch to has_mode for StatRes fbs (#761) 2018-09-17 16:53:55 -07:00
ztplz
0260aaf8c2 Change FileInfo to interface (#765) 2018-09-17 12:00:57 -07:00
Kevin (Kun) "Kassimo" Qian
b0958073ba Remove remove_timer asserts (#760)
* Remove remove_timer asserts

* Add clearTimeout invalid id no-panic test

* Move timer test to its file AND some lint side-effects
2018-09-16 13:35:16 -07:00
J2P
0040486539 Fix comments in stat.ts file 2018-09-16 09:12:00 -07:00
Kitson Kelly
0ef28bec4d Improve integration of dom_types 2018-09-16 09:10:36 -07:00
Parsa Ghadimi
4b1eb855bf Make fetch.blob() work 2018-09-14 12:50:32 -07:00
Kevin (Kun) "Kassimo" Qian
662e57b20a [fs] Enable mode for mkdir on unix (#746) 2018-09-14 12:30:43 -07:00
Parsa Ghadimi
66c09de967 Rename fetch_types.d.ts to dom_types.d.ts 2018-09-14 12:27:32 -07:00
Parsa Ghadimi
7b7052e1ab Implement Blob 2018-09-14 10:04:10 -07:00
justjavac
aaf70ca092 fix command line flag in the comment 2018-09-14 08:25:45 -04:00
Yoshiya Hinosawa
0ca7301a2d
feat: add deno.makeTempDir 2018-09-12 22:33:11 -07:00
qti3e
41c70b154f Add support for fetch() headers (#727) 2018-09-12 15:16:42 -04:00
Mani Maghsoudlou
88d42f0b18 Implement deno.rename() (#731) 2018-09-12 11:44:58 -04:00
Kevin (Kun) "Kassimo" Qian
26081a32df Add unix-only mode for FileInfo (#732) 2018-09-12 10:28:48 -04:00
Kevin (Kun) "Kassimo" Qian
1ffae65165 Add remove(), removeAll().
and removeSync(), removeAllSync().
2018-09-12 10:24:17 -04:00
Sajjad Hashemian
7c50c11f40 Implement deno.stat() and deno.lstat() 2018-09-11 16:05:00 -04:00
Parsa Ghadimi
806385543c Improve global types 2018-09-11 12:19:44 -04:00
Kevin (Kun) "Kassimo" Qian
05f87a0cf2 Move writeFileSync to write_file.ts, add writeFile and tests (#728) 2018-09-11 12:00:57 -04:00
Sajjad Hashemian
c2663e1d82 Implement deno.mkdir() 2018-09-10 15:02:07 -04:00
Ryan Dahl
35bc9ddf63 Implement deno.readFile()
As an example of how to implement ops that have both sync and async
versions.
2018-09-10 00:14:28 -04:00
Ryan Dahl
3afc0b8482 fbs_util.ts -> dispatch.ts
And send() -> sendSync()
2018-09-10 00:14:28 -04:00
Ryan Dahl
e2a285b871 Better NotFound error handling in CodeFetch
throwResolutionError was swallowing unrelated errors.
2018-09-09 23:12:22 -04:00
Ryan Dahl
8090fb252b Expose deno.ErrorKind
Originally we planned to have a JS class for each error code. But it
seems better to just have a single DenoError class with a "kind"
property. One nice thing about using an enum instead of classes for
errors is that switch() can be used during error handling instead of a
bunch of instanceof branches.
2018-09-09 23:12:22 -04:00
Ryan Dahl
a4f1b367b9 Remove namespace from src/msg.fbs 2018-09-09 23:12:22 -04:00
Ryan Dahl
0d03fafbfe Map promises onto futures.
Refactors handlers.rs

The idea is that all Deno "ops" (aka bindings) should map onto
a Rust Future. By setting the "sync" flag in the Base message
users can determine if the future is executed immediately or put
on the event loop.

In the case of async futures, a promise is automatically created.
Errors are automatically forwarded and raised.

TODO:

- The file system ops in src/handler.rs are not using the thread pool
  yet. This will be done in the future using tokio_threadpool::blocking.
  That is, if you try to call them asynchronously, you will get a promise
  and it will act asynchronous, but currently it will be blocking.
- Handlers in src/handler.rs returned boxed futures. This was to make
  it easy while developing. We should try to remove this allocation.
2018-09-09 18:47:22 -04:00
Ryan Dahl
ff6eefdf87 Add better assert message for CodeFetchRes 2018-09-09 18:47:22 -04:00
Daniel Ramos
b7ebc1b699 Add type aliases for sourceCode and outputCode 2018-09-09 10:51:15 -04:00
J2P
d814949896 Add and edit comments 2018-09-07 12:01:43 -04:00
Kitson Kelly
9101fd1493 Cleanup public API of DenoCompiler 2018-09-06 18:31:32 -04:00
Kitson Kelly
11aef6e107 Integrate format diagnostic host in DenoCompiler 2018-09-06 18:31:32 -04:00
Parsa Ghadimi
1052f8d0c9 Check allow-net in fetch 2018-09-06 11:07:10 -04:00
Kitson Kelly
1e709aa348 Fix TypeScript exports in bundle 2018-09-06 11:04:56 -04:00
Mirko Jotic
fcdfacc2de Implementing --deps flag
- Adding a ModuleId type alias to specify original url or local file of
dependency
- Modifying ModuleMetaData class to contain ModuleId
- Adding a --deps flag
2018-09-06 10:42:07 -04:00
Ryan Dahl
32f0c37a42 Format 2018-09-05 22:27:47 -04:00
Kitson Kelly
10dc71133a Mark APIs at internal and include JSDoc in types 2018-09-05 08:45:55 -04:00
Ryan Dahl
d6c310596e lStat -> lstat 2018-09-04 15:57:18 -04:00
Mani Maghsoudlou
641e3d404d Implement renameSync 2018-09-04 11:57:04 -04:00
Sajjad Hashemian
b2b4299e3b Implement mkdirSync 2018-09-03 15:06:00 -04:00
Ryan Dahl
787832c68e Format. 2018-09-03 10:45:58 -04:00
Kitson Kelly
77faad8070 Unit tests for circular references 2018-09-02 11:28:45 -04:00
Kitson Kelly
739ef6a8ec Fix circular dependencies 2018-09-02 11:28:45 -04:00
ShinDarth
bbc4e55bda Minor code refactoring 2018-09-01 21:59:52 -04:00
liuyi
2eb80f3617 Refactor code to be same style 2018-09-01 16:47:43 -04:00
Kitson Kelly
b3dac82887 Remove lib.globals.d.ts 2018-09-01 15:06:03 -04:00
Kitson Kelly
f83aee02e6 Bundle most types into globals.d.ts (#642) 2018-09-01 10:45:26 -04:00
Aaron Power
9b7e5a2558 Document lStatSync & statSync and correct FileInfo. 2018-08-31 16:18:31 -04:00
Aaron Power
f131445a46 Implemented deno.env and refactored flags.rs 2018-08-31 13:18:24 -04:00
Ryan Dahl
45dafe15ee Refactor libdeno.send() code to reduce boilerplate.
Also removes assignCmdId as it's currently unused.
2018-08-31 10:43:11 -04:00
Ryan Dahl
0ec629d105 format 2018-08-30 14:41:55 -04:00
Ryan Dahl
2dd9a8d028 Reorganize js/unit_tests.ts 2018-08-30 14:41:55 -04:00
Aaron Power
b86bf4d8a4 Implemented statSync and lStatSync 2018-08-30 12:39:33 -04:00
ztplz
b2cd71ddce add type declaration 2018-08-30 03:21:05 -04:00
Bert Belder
ceaf822682
Implement makeTempDirSync() 2018-08-29 22:40:05 +02:00
Ryan Dahl
0c2abb9339 Allow filtering of unit tests. 2018-08-29 12:05:58 -04:00
Kitson Kelly
634a9e3932 Updates to compiler.ts comments and logging. 2018-08-28 08:44:34 -04:00
Kitson Kelly
54aefa2886 Two-pass module evaluation.
Plus changes to tests to accomodate.
2018-08-28 08:44:34 -04:00
Bert Belder
7e3d9f8f2b
format 2018-08-28 02:01:41 +02:00
Ryan Dahl
e13f3c10ca Add ability to unit test by permissions. 2018-08-27 17:51:24 -04:00
Ryan Dahl
722c7e4a1b Add deno.argv. 2018-08-27 17:51:24 -04:00
Aaron Power
f43259e5ab Moved console tests to own file, and switched circular test to use stringify with assertEqual 2018-08-27 17:18:37 -04:00
Aaron Power
0f1db89aa6 Fixed printing strings in arrays & objects without quotes 2018-08-27 13:45:29 -04:00
Yoshiya Hinosawa
17d6d6b336 refactor: add and use libdeno.setGlobalErrorHandler instead of window.onerror 2018-08-26 11:03:41 -04:00