Skip to content

Commit

Permalink
fix: getInterfaceOf now does far functions
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Jul 27, 2021
1 parent 33fa672 commit 8c0d0b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/marshal/src/passStyleOf.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ const assertRemotable = val => {
/** @type {MarshalGetInterfaceOf} */
export const getInterfaceOf = val => {
if (
typeof val !== 'object' ||
(typeof val !== 'object' && typeof val !== 'function') ||
val === null ||
val[PASS_STYLE] !== 'remotable' ||
!checkRemotable(val)
Expand Down
3 changes: 2 additions & 1 deletion packages/marshal/test/test-marshal-far-function.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';

import { Far } from '../src/marshal.js';
import { passStyleOf } from '../src/passStyleOf.js';
import { getInterfaceOf, passStyleOf } from '../src/passStyleOf.js';

const { freeze } = Object;

test('Far functions', t => {
t.notThrows(() => Far('arrow', a => a + 1), 'Far function');
const arrow = Far('arrow', a => a + 1);
t.is(passStyleOf(arrow), 'remotable');
t.is(getInterfaceOf(arrow), 'Alleged: arrow');
});

test('Acceptable far functions', t => {
Expand Down

0 comments on commit 8c0d0b9

Please sign in to comment.