swc/ecmascript/babel/compat/tests/fixtures/class-static/input.js

16 lines
252 B
JavaScript
Raw Normal View History

class Point {
constructor(x, y) {
this.x = x;
this.y = y;
}
static displayName = "Point";
static distance(a, b) {
const dx = a.x - b.x;
const dy = a.y - b.y;
return Math.hypot(dx, dy);
}
}