functionalscript 0.0.443 → 0.0.444

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -230,8 +230,12 @@ const rust = library => {
230
230
  traitImpl({
231
231
  pub: true,
232
232
  type: 'ClassEx',
233
- content: [`const INTERFACE: Interface = Interface {`,
234
- mapAssign(e),
233
+ content: ['const VMT: Vmt = Vmt {',
234
+ [ 'iunknown: Self::IUNKNOWN,',
235
+ 'interface: Interface {',
236
+ mapAssign(e),
237
+ '},',
238
+ ],
235
239
  '};'
236
240
  ]
237
241
  }),
@@ -36,9 +36,12 @@ mod library {
36
36
  where
37
37
  nanocom::CObject<Self>: Ex,
38
38
  {
39
- const INTERFACE: Interface = Interface {
40
- A: Self::A,
41
- B: Self::B,
39
+ const VMT: Vmt = Vmt {
40
+ iunknown: Self::IUNKNOWN,
41
+ interface: Interface {
42
+ A: Self::A,
43
+ B: Self::B,
44
+ }
42
45
  };
43
46
  }
44
47
 
@@ -73,10 +76,7 @@ mod number {
73
76
  impl nanocom::Class for X {
74
77
  type Interface = IMy::Interface;
75
78
  fn static_vmt() -> &'static Vmt<Self::Interface> {
76
- static V: IMy::Vmt = Vmt {
77
- iunknown: X::IUNKNOWN,
78
- interface: X::INTERFACE,
79
- };
79
+ static V: IMy::Vmt = X::VMT;
80
80
  &V
81
81
  }
82
82
  }
@@ -142,10 +142,7 @@ mod destructor {
142
142
  impl nanocom::Class for X {
143
143
  type Interface = IMy::Interface;
144
144
  fn static_vmt() -> &'static Vmt<Self::Interface> {
145
- static V: IMy::Vmt = Vmt {
146
- iunknown: X::IUNKNOWN,
147
- interface: X::INTERFACE,
148
- };
145
+ static V: IMy::Vmt = X::VMT;
149
146
  &V
150
147
  }
151
148
  }
@@ -66,14 +66,17 @@ module.exports = () => {
66
66
  ' Self: nanocom::Class<Interface = Interface>,\n' +
67
67
  ' nanocom::CObject<Self>: Ex,\n' +
68
68
  ' {\n' +
69
- ' const INTERFACE: Interface = Interface {\n' +
70
- ' GetSlice: Self::GetSlice,\n' +
71
- ' SetSlice: Self::SetSlice,\n' +
72
- ' GetUnsafe: Self::GetUnsafe,\n' +
73
- ' SetUnsafe: Self::SetUnsafe,\n' +
74
- ' Some: Self::Some,\n' +
75
- ' GetIMy: Self::GetIMy,\n' +
76
- ' SetManagedStruct: Self::SetManagedStruct,\n' +
69
+ ' const VMT: Vmt = Vmt {\n' +
70
+ ' iunknown: Self::IUNKNOWN,\n' +
71
+ ' interface: Interface {\n' +
72
+ ' GetSlice: Self::GetSlice,\n' +
73
+ ' SetSlice: Self::SetSlice,\n' +
74
+ ' GetUnsafe: Self::GetUnsafe,\n' +
75
+ ' SetUnsafe: Self::SetUnsafe,\n' +
76
+ ' Some: Self::Some,\n' +
77
+ ' GetIMy: Self::GetIMy,\n' +
78
+ ' SetManagedStruct: Self::SetManagedStruct,\n' +
79
+ ' },\n' +
77
80
  ' };\n' +
78
81
  ' }\n' +
79
82
  ' impl<T> ClassEx for T\n' +
@@ -1 +1,43 @@
1
+ use crate::_result::IMy::ClassEx;
2
+
1
3
  mod _result;
4
+
5
+ struct My {}
6
+
7
+ impl nanocom::Class for My {
8
+ type Interface = _result::IMy::Interface;
9
+ fn static_vmt() -> &'static _result::IMy::Vmt {
10
+ static VMT: _result::IMy::Vmt = My::VMT;
11
+ &VMT
12
+ }
13
+ }
14
+
15
+ impl _result::IMy::Ex for nanocom::CObject<My> {
16
+ fn GetSlice(&self) -> _result::Slice {
17
+ todo!()
18
+ }
19
+
20
+ fn SetSlice(&self, slice: _result::Slice) {
21
+ todo!()
22
+ }
23
+
24
+ fn GetUnsafe(&self) -> *const bool {
25
+ todo!()
26
+ }
27
+
28
+ fn SetUnsafe(&self, p: *const _result::Slice, size: u32) {
29
+ todo!()
30
+ }
31
+
32
+ fn Some(&self, p: &_result::IMy::Object) -> bool {
33
+ todo!()
34
+ }
35
+
36
+ fn GetIMy(&self) -> _result::IMy::Ref {
37
+ todo!()
38
+ }
39
+
40
+ fn SetManagedStruct(&self, a: _result::ManagedStruct) {
41
+ todo!()
42
+ }
43
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "functionalscript",
3
- "version": "0.0.443",
3
+ "version": "0.0.444",
4
4
  "description": "FunctionalScript is a functional subset of JavaScript",
5
5
  "main": "module.f.cjs",
6
6
  "scripts": {