Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't create segment with optional second point omitted #84

Open
herobank110 opened this issue Mar 31, 2021 · 1 comment
Open

can't create segment with optional second point omitted #84

herobank110 opened this issue Mar 31, 2021 · 1 comment

Comments

@herobank110
Copy link

One of the overloads of the segment constructor allegedly is:
(ps?: Point | undefined, pe?: Point | undefined) => Segment
However when omitting the 2nd argument it fails.

Code

import Geom from '@flatten-js/core';
const { point, segment } = Geom;
segment(point(200, 200))

This code compiles correctly in Typescript.

Output

Uncaught ReferenceError: Illegal Parameters
    at Function.get ILLEGAL_PARAMETERS [as ILLEGAL_PARAMETERS] (index.js:8730)
    at new Segment (index.js:13059)
    at segment (index.js:13369)
    at Object.3syrK.jquery (index.js:453)
    at newRequire (index.js:71)
    at index.js:120
    at index.js:143

Expected
segment(point(200, 200))
should run with throwing error and be equivalent to
segment(point(200, 200), point())

alexbol99 added a commit that referenced this issue May 16, 2021
@alexbol99
Copy link
Owner

Option supported in v1.2.23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants