scoundrel-remote-eval 1.0.4 → 1.0.5
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.
package/package.json
CHANGED
|
@@ -35,4 +35,15 @@ describe("scoundrel - web-socket - javascript", () => {
|
|
|
35
35
|
|
|
36
36
|
expect(result).toEqual(["test1", "test2"])
|
|
37
37
|
})
|
|
38
|
+
|
|
39
|
+
it("returns results from method calls", async () => {
|
|
40
|
+
const stringObject = await shared.client.newObjectWithReference("Array")
|
|
41
|
+
|
|
42
|
+
await stringObject.callMethod("push", "test1")
|
|
43
|
+
await stringObject.callMethod("push", "test2")
|
|
44
|
+
|
|
45
|
+
const result = await stringObject.callMethod("join", ", ")
|
|
46
|
+
|
|
47
|
+
expect(result).toEqual("test1, test2")
|
|
48
|
+
})
|
|
38
49
|
})
|
package/src/client/index.js
CHANGED
|
@@ -16,13 +16,15 @@ export default class Client {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
async callMethodOnReference(referenceId, methodName, ...args) {
|
|
19
|
-
|
|
19
|
+
const result = await this.backend.send({
|
|
20
20
|
args: this.parseArg(args),
|
|
21
21
|
command: "call_method_on_reference",
|
|
22
22
|
method_name: methodName,
|
|
23
23
|
reference_id: referenceId,
|
|
24
24
|
with: "result"
|
|
25
25
|
})
|
|
26
|
+
|
|
27
|
+
return result.response
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
async callMethodOnReferenceWithReference(referenceId, methodName, ...args) {
|