alastaircoote / esperanto Goto Github PK
View Code? Open in Web Editor NEWUse Rust interfaces inside a JavaScript environment. Eventually.
Use Rust interfaces inside a JavaScript environment. Eventually.
In QuickJS mode looks like working but I got errors with javascriptcore feature
error[E0432]: unresolved import `crate::shared::engine_impl::export`
--> vendors/esperanto/src/shared/export/jsexportclass.rs:1:33
|
1 | use crate::shared::engine_impl::export::{JSCallAsConstructorImpl, JSCallAsFunctionImpl};
| ^^^^^^ could not find `export` in `engine_impl`
error[E0432]: unresolved import `jscoreexport::JSCoreClassDefinition`
--> vendors/esperanto/src/jscore/mod.rs:15:9
|
15 | pub use jscoreexport::JSCoreClassDefinition as JSClassDefinitionImpl;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `JSCoreClassDefinition` in `jscore::jscoreexport`
warning: unused import: `std::ffi::CString`
--> vendors/esperanto/src/jscore/exception.rs:1:5
|
1 | use std::ffi::CString;
| ^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused imports: `OpaqueJSContext`, `OpaqueJSValue`
--> vendors/esperanto/src/jscore/exception.rs:3:26
|
3 | use javascriptcore_sys::{OpaqueJSContext, OpaqueJSValue};
| ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^
warning: unused imports: `jscorecontextpointer::JSCoreContextPointer`, `jscorevalue::JSCoreValueInternal`
--> vendors/esperanto/src/jscore/exception.rs:5:13
|
5 | use super::{jscorecontextpointer::JSCoreContextPointer, jscorevalue::JSCoreValueInternal};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused imports: `CatchExceptionError`, `EsperantoError`
--> vendors/esperanto/src/jscore/exception.rs:6:29
|
6 | use crate::shared::errors::{CatchExceptionError, EsperantoError};
| ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
warning: unused import: `crate::shared::value::JSValueInternal`
--> vendors/esperanto/src/jscore/exception.rs:7:5
|
7 | use crate::shared::value::JSValueInternal;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused imports: `DerefMut`, `Deref`, `marker::PhantomData`
--> vendors/esperanto/src/jscore/jscorestring.rs:4:5
|
4 | marker::PhantomData,
| ^^^^^^^^^^^^^^^^^^^
5 | ops::{Deref, DerefMut},
| ^^^^^ ^^^^^^^^
warning: unused imports: `convert::TryFrom`, `ops::Deref`
--> vendors/esperanto/src/jscore/jscorevaluepointer.rs:1:11
|
1 | use std::{convert::TryFrom, ops::Deref};
| ^^^^^^^^^^^^^^^^ ^^^^^^^^^^
warning: unused import: `jscorevalue`
--> vendors/esperanto/src/jscore/jscorevaluepointer.rs:10:57
|
10 | use super::{jscorecontextpointer::JSCoreContextPointer, jscorevalue};
| ^^^^^^^^^^^
error[E0282]: type annotations needed
--> vendors/esperanto/src/shared/export/jsexportclass.rs:16:23
|
16 | call_as_function: None,
| ^^^^ cannot infer type for type parameter `T` declared on the enum `Option`
error[E0046]: not all trait items implemented, missing: `get_native_ref`, `delete_property`
--> vendors/esperanto/src/jscore/jscorevalue.rs:27:1
|
27 | impl JSValueInternal for JSCoreValueInternal {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `get_native_ref`, `delete_property` in implementation
|
::: vendors/esperanto/src/shared/value/value_internal.rs:53:5
|
53 | fn get_native_ref<T:JSExportClass>(self, ctx: Self::ContextType) -> T;
| ---------------------------------------------------------------------- `get_native_ref` from trait
...
69 | fn delete_property(self, ctx: Self::ContextType, name: &CStr) -> EsperantoResult<()>;
| ------------------------------------------------------------------------------------- `delete_property` from trait
error[E0599]: no associated item named `CLASS_DEFINITION` found for type parameter `T` in the current scope
--> vendors/esperanto/src/jscore/jscorevalue.rs:106:29
|
106 | let definition = T::CLASS_DEFINITION;
| ^^^^^^^^^^^^^^^^ associated item not found in `T`
Rust 1.62.0 stable
Something like
let result = ctx.evaluate(
"await ((async()=>{ await sleep(10000); return 'some result'; })())",
None).unwrap();
Just haven't got around to fixing that up yet
We have to manually create function() {}
, which allows the body to escape the function definition. Should fix that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.