@@ -134,18 +134,15 @@ jnode.setRNode(rnode);
134
134
- [ wrap] ( #wrap )
135
135
- [ Parameters] ( #parameters-4 )
136
136
- [ Examples] ( #examples-2 )
137
- - [ JsValueTransport] ( #jsvaluetransport )
138
137
- [ RbValue] ( #rbvalue )
139
- - [ Parameters] ( #parameters-5 )
140
138
- [ call] ( #call )
141
- - [ Parameters] ( #parameters-6 )
139
+ - [ Parameters] ( #parameters-5 )
142
140
- [ Examples] ( #examples-3 )
143
141
- [ toPrimitive] ( #toprimitive )
144
- - [ Parameters] ( #parameters-7 )
142
+ - [ Parameters] ( #parameters-6 )
145
143
- [ toString] ( #tostring )
146
144
- [ toJS] ( #tojs )
147
145
- [ RbError] ( #rberror )
148
- - [ Parameters] ( #parameters-8 )
149
146
150
147
### RubyVM
151
148
@@ -237,37 +234,10 @@ hash.call("store", vm.eval(`"key1"`), vm.wrap(new Object()));
237
234
238
235
Returns ** any** the RbValue object representing the given JS value
239
236
240
- ### JsValueTransport
241
-
242
- Export a JS value held by the Ruby VM to the JS environment.
243
- This is implemented in a dirty way since wit cannot reference resources
244
- defined in other interfaces.
245
- In our case, we can't express ` function(v: rb-abi-value) -> js-abi-value `
246
- because ` rb-js-abi-host.wit ` , that defines ` js-abi-value ` , is implemented
247
- by embedder side (JS) but ` rb-abi-guest.wit ` , that defines ` rb-abi-value `
248
- is implemented by guest side (Wasm).
249
-
250
- This class is a helper to export by:
251
-
252
- 1 . Call ` function __export_to_js(v: rb-abi-value) ` defined in guest from embedder side.
253
- 2 . Call ` function takeJsValue(v: js-abi-value) ` defined in embedder from guest side with
254
- underlying JS value of given ` rb-abi-value ` .
255
- 3 . Then ` takeJsValue ` implementation escapes the given JS value to the ` _takenJsValues `
256
- stored in embedder side.
257
- 4 . Finally, embedder side can take ` _takenJsValues ` .
258
-
259
- Note that ` exportJsValue ` is not reentrant.
260
-
261
237
### RbValue
262
238
263
239
A RbValue is an object that represents a value in Ruby
264
240
265
- #### Parameters
266
-
267
- - ` inner `
268
- - ` vm `
269
- - ` privateObject `
270
-
271
241
#### call
272
242
273
243
Call a given method with given arguments
@@ -291,7 +261,7 @@ console.log(ary.call("sample").toString());
291
261
292
262
##### Parameters
293
263
294
- - ` hint `
264
+ - ` hint ` Preferred type of the result primitive value. ` "number" ` , ` "string" ` , or ` "default" ` .
295
265
296
266
#### toString
297
267
@@ -310,10 +280,6 @@ Returns null if the value is not convertible to a JavaScript object.
310
280
311
281
Error class thrown by Ruby execution
312
282
313
- #### Parameters
314
-
315
- - ` message `
316
-
317
283
## Building the package from source
318
284
319
285
The instructions for building a Ruby targeting WebAssembly are available [ here] ( https://github.com/ruby/ruby.wasm#building-from-source ) .
0 commit comments