atom/flight-manual.atom.io

ReferenceError: Point is not defined - deprecated?

Closed this issue · 2 comments

Prerequisites

Description

The Point class doesn't work.

Steps to Reproduce

  1. Open dev tools console
  2. Run new Point(0, 0)

Expected behavior:

It returns an instance of Point.

Actual behavior:

Uncaught ReferenceError: Point is not defined

Reproduces how often:

Every time.

Versions

Atom : 1.40.1
Electron: 3.1.10
Chrome : 66.0.3359.181
Node : 10.2.0

(apm --version returns AssignProcessToJobObject: (87) The parameter is incorrect., a bug at time of writing I assume)

Windows 10 v1903 build 18362.418 64-bit

Additional Information

See also

It seem's point.coffee has been deprecated but it is still on the documentation.

posted by @lachhebo in atom/atom#7893 (comment)

Actually, on further investigation, it merely seems that Point is not imported into the console. I had tried running new Range([0,0], [0,1]) in the console as well and it apparently worked where Point didn't, however the Range object returned didn't match the flight manual, so I'm not sure what is actually going on there.

It sounds like you're running into a confusion between the Point Web API, and Atom's Point class.

You need to run something like this in order to have access to Atom's Point:

const { Point } = require('atom');

The same holds true for Range, which also has a Web API of the same name.

Thanks for reaching out!


Because we treat our issues list as the Atom team's backlog, we close issues that are questions since they don't represent a task needing to be completed. For most questions about Atom there are a lot of options, check out:

On Discuss and in the Atom Slack team, there are a bunch of helpful community members that should be willing to point you in the right direction.