alastaircoote / esperanto

Use Rust interfaces inside a JavaScript environment. Eventually.
12 stars 1 forks source link

Can`t run is javascriptcore mode #5

Open caracal7 opened 2 years ago

caracal7 commented 2 years ago

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

alastaircoote commented 1 year ago

Sorry, I've been focused on the QuickJS mode, particularly creating custom classes. Once I've got that working I'll switch over to JSC!