如何打印出 Path2D 对象的名称?
var test = new Path2D() 然后遵循绘图代码。
然后我用 if 语句将变量 test 存储在另一个变量中。
if (ctx.isPointInPath(test, event.offsetX, event.offsetY)) {
something = test ...
console.log(something) will give Path2D {}.
console.log(toString(something)) will give [object undefined].
console.log(JSON.stringify(something)) will give {}.