Skip to content

Commit

Permalink
feat(exo): defineExoClassKitFromJSClassKit
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Aug 14, 2024
1 parent bec206b commit 6306db2
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/exo/test/exo-wobbly-point.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
/* eslint-disable max-classes-per-file */
import test from '@endo/ses-ava/prepare-endo.js';

import { Fail, q } from '@endo/errors';
import { objectMap } from '@endo/common/object-map.js';
import { getMethodNames } from '@endo/eventual-send/utils.js';
import { passStyleOf, Far, GET_METHOD_NAMES } from '@endo/pass-style';
import { M } from '@endo/patterns';

import { Fail, q } from '@endo/errors';
import { GET_INTERFACE_GUARD } from '../src/get-interface.js';
import { defineExoClass } from '../src/exo-makers.js';
import { defineExoClass, defineExoClassKit } from '../src/exo-makers.js';

const { apply } = Reflect;

Expand All @@ -40,6 +41,16 @@ const defineExoClassFromJSClass = klass =>
defineExoClass(klass.name, klass.implements, klass.init, klass.prototype);
harden(defineExoClassFromJSClass);

// Need an example use.
// eslint-disable-next-line no-unused-vars
const defineExoClassKitFromJSClassKit = (name, init, klassKit) =>
defineExoClassKit(
name,
objectMap(klassKit, klass => klass.implements),
init,
objectMap(klassKit, klass => klass.prototype),
);

const ExoPointI = M.interface('ExoPoint', {
toString: M.call().returns(M.string()),
getX: M.call().returns(M.gte(0)),
Expand Down

0 comments on commit 6306db2

Please sign in to comment.