mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 06:36:08 +03:00
6896a83d54
swc_ecma_codegen: - Emit pending semi on `~`. (#2091)
16 lines
252 B
JavaScript
16 lines
252 B
JavaScript
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);
|
|
}
|
|
}
|