<分区>
我有一些代码:
"use strict";
class Node {
constructor() {
}
}
class Person extends Node {
constructor() {
}
}
const fred = new Person();
在 Node v4.2.4 中运行它给出错误:
ReferenceError: this is not defined
at Person (/home/chris/test.js:12:3)
第 12 行是 Person::constructor 的右括号。
为什么我不能扩展 Node 类?