Bert Belder
926f3a19da
Update generated types/traits, and generate more types ( #300 )
2020-03-05 17:42:55 -08:00
Bert Belder
ddc8062644
Move get_*_context() methods to scope::Entered, remove InContext trait ( #279 )
...
The `get_current_context()` and `get_entered_or_microtask_context()`
methods now return `Option<Local<Context>>` to reflect that an isolate
may not have entered any context.
They're also moved from `Isolate` to `struct Entered` because it turns
out that the underlying V8 API calls actually create new local handles,
hence they should only be used inside an active HandleScope.
The `InContext` trait has been removed.
A test exercising `ContextScope` and the `get_*_context()` methods
mentioned above was added.
Closes: #248 .
2020-02-12 22:00:31 -08:00
Ryan Dahl
27277ad801
Add IsolateHandle ( #274 )
...
Co-authored-by: Bert Belder <bertbelder@gmail.com>
2020-02-12 11:33:58 -05:00
Ryan Dahl
32abe84dc6
Remove v8::Locker ( #272 )
...
This patch clarifies that v8::Isolate is a single threaded creature,
which can only be accessed from other threads in special circumstances.
To ensure optimal operation in Deno, we remove v8::Locker, which ought
to be unnecessary when a thread is dedicated to each Isolate and the
Isolates never move between threads.
There are valid use-cases for v8::Locker, and we hope to address them in
future versions of rusty_v8.
Co-authored-by: Bert Belder <bertbelder@gmail.com>
2020-02-11 17:01:27 -05:00
Ryan Dahl
db33bc9aec
Expose TaskBase and TaskImpl
2020-01-23 11:57:25 -05:00
Bert Belder
8617f77fd3
Refactor v8::Object bindings ( #243 )
...
* Rename `Object::new2()` to `Object::with_prototype_and_properties()`.
* Make `Object::with_prototype_and_properties()` take a slice of keys
and a slice of values as arguments, instead of using
`Vec<v8::Local<v8::Name>>` and `Vec<v8::Local<v8::Value>>>`.
* Remove type `MaybeBool` from the public interface. These methods now
return `Option<bool>` instead.
* Fix parameter type mismatches between Rust and C++ APIs.
2020-01-22 23:13:58 +01:00
Andy Finch
d302180ffa
remove pub use support::int;
#235 ( #239 )
2020-01-22 11:01:49 -05:00
Ryan Dahl
791cbc627a
Add docs about scopes to lib.rs
2020-01-21 09:45:32 -05:00
Bert Belder
44d58f8f48
Make Locker also a Scope ( #229 )
2020-01-21 02:03:45 +01:00
Ben Noordhuis
6efb395fdc
Add Object::define_own_property() ( #228 )
...
This commit introduces the NONE, READ_ONLY, DONT_ENUM and DONT_DELETE
property attributes.
2020-01-20 11:16:24 -05:00
Ben Noordhuis
7b0269b447
Add ObjectTemplate and Template::set() ( #225 )
...
The ObjectTemplate type already existed but now it can also be
instantiated.
This commit also adds Template::set() to actually make that useful.
2020-01-19 21:58:20 +01:00
Bert Belder
6c1d65252a
Add ContextScope and lay foundations for scope inheritance ( #223 )
2020-01-18 13:41:28 +01:00
Ry Dahl
7a198e0c7e
Reduce nested symbols in API ( #220 )
...
- Don't expose empty mod array_buffer_view
- Move v8::platform::new_default_platform() to v8::new_default_platform()
- Move v8::platform::Task to v8::Task
- Move v8::platform::Platform to v8::Platform
2020-01-17 09:26:42 -05:00
Bartek Iwańczuk
f650abe44e
stub out inspector APIs ( #206 )
2020-01-16 18:12:25 -05:00
Bert Belder
a230735902
Refactor scopes and callbacks so users don't need to transmute ( #183 )
2020-01-16 22:48:27 +01:00
Ry Dahl
19398816ab
SnapshotCreator changes for libdeno ( #176 )
2020-01-03 16:52:05 -05:00
Ry Dahl
45b766c01f
happy new year ( #170 )
2020-01-02 13:57:00 -05:00
Ry Dahl
65f12fbdc0
Add Object::set_accessor ( #167 )
2020-01-02 12:01:36 -05:00
Ry Dahl
e501f6d854
Add Value::{ToString, ToNumber, ToObject} ( #162 )
2019-12-31 15:17:52 -05:00
Ry Dahl
b7fa3341cb
Replace transmute in example with cast ( #153 )
2019-12-30 15:54:24 -05:00
Bert Belder
9a72f62bd6
Add complete V8 type hierarchy ( #148 )
2019-12-30 19:06:45 +01:00
Andy Finch
00d592cd4d
add v8::SharedArrayBuffer ( #134 )
2019-12-28 16:29:42 -05:00
Ryan Dahl
61c74ec0e7
clean up example in docs
2019-12-27 12:04:28 -05:00
Ry Dahl
6f953179ba
External references for snapshots ( #141 )
2019-12-27 09:12:16 -05:00
EnokMan
f2cc688439
add hello world example ( #142 )
2019-12-27 06:41:44 -05:00
Bert Belder
76a480e6ff
Add ArrayBuffer::get_backing_store() and new_with_backing_store() ( #135 )
2019-12-26 18:06:43 +01:00
Ry Dahl
ce38f674f7
Support dynamic import ( #136 )
2019-12-26 10:45:55 -05:00
Andy Finch
6cdb55ed62
add v8::Uint8Array ( #133 )
2019-12-25 20:37:25 -05:00
Ry Dahl
877c22b075
Move new_default_allocator to root namespace ( #132 )
...
And add Isolate::set_data, Isolate::get_data, Isolate::get_number_of_data_slots
2019-12-25 10:56:27 -05:00
Bert Belder
ae4b48eb22
Get rid of HandleScope closure, add CallbackScope ( #119 )
2019-12-25 00:31:36 +01:00
Ry Dahl
d65c604f3a
Add Object::create_data_property, Object::get, Value::is_array, Value::is_object, Value::is_function ( #129 )
2019-12-24 16:10:40 -05:00
Bartek Iwańczuk
1507a897de
first pass at snapshots ( #122 )
...
Creating a snapshot leaks memory. We will address this in future work.
2019-12-24 08:03:32 -05:00
Andy Finch
37a13ae18c
add v8::ArrayBufferView ( #101 )
2019-12-24 05:50:30 -05:00
Ry Dahl
b97abb17b9
default options for v8::script_compiler::compile_module ( #125 )
...
And other clean ups
2019-12-23 20:23:55 -05:00
Ry Dahl
3ec3b07638
first pass implementation for v8::Module ( #120 )
...
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2019-12-23 07:12:52 -05:00
Bartek Iwańczuk
25c4f7f4d0
add v8::EscapableHandleScope ( #113 )
2019-12-22 15:05:39 +01:00
Bert Belder
c107eb871f
Add global (a.k.a Persistent) handles ( #112 )
2019-12-22 01:30:22 +01:00
Ry Dahl
f36e74a648
First pass at BackingStore ( #108 )
2019-12-21 11:05:51 -05:00
Ry Dahl
153018b41b
Add ArrayBuffer, move ArrayBuffer::Allocator to root namespace ( #106 )
2019-12-21 08:50:59 -05:00
Ry Dahl
99baef0169
Add PrimitiveArray and ScriptOrModule ( #105 )
2019-12-21 06:38:26 -05:00
Bert Belder
fab24e032e
Make TryCatchScope public, improve doc strings ( #102 )
2019-12-21 06:11:06 +01:00
Bert Belder
f839aa221a
Add TryCatch ( #97 )
2019-12-21 02:12:11 +01:00
Ry Dahl
bbfaacfe56
Add v8::ScriptCompiler::compile_module ( #96 )
2019-12-20 14:54:20 -05:00
Bartek Iwańczuk
85229bdd8a
add v8::PropertyCallbackInfo ( #68 )
2019-12-20 18:16:44 +01:00
Bartek Iwańczuk
beb9272f38
stub out v8::Module ( #69 )
2019-12-20 08:56:32 -05:00
Ry Dahl
e89a968ff2
add more docs and clean up exception, json modules ( #92 )
2019-12-20 08:47:20 -05:00
Ry Dahl
68742be011
Remove lifetimes from Local, HandleScope, Locker ( #90 )
...
add v8_str
2019-12-19 23:36:29 -05:00
Ry Dahl
b610e7cda9
Add v8::Isolate::add_message_listener ( #89 )
2019-12-19 21:34:07 -05:00
Ry Dahl
11ba352065
Rename CxxIsolate to Isolate and Isolate to OwnedIsolate ( #85 )
2019-12-19 19:15:52 -05:00
Bartek Iwańczuk
cb0d2e3bec
add v8::PromiseRejectMessage ( #65 )
2019-12-19 14:13:33 +01:00