1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 18:32:22 +00:00

docs(class): fixed #1099

This commit is contained in:
ruanyf 2021-12-03 01:46:25 +08:00
parent 4781407a68
commit 664f6850f7

View File

@ -1028,7 +1028,7 @@ A.test(o1) // false
A.test(o1.__proto__) // true
const o2 = {};
Object.setPrototypeOf(o2, A);
Object.setPrototypeOf(o2, a);
A.test(o2) // false
A.test(o2.__proto__) // true
```
@ -1204,3 +1204,4 @@ var y = new Rectangle(3, 4); // 正确
上面代码中,`Shape`类不能被实例化,只能用于继承。
注意,在函数外部,使用`new.target`会报错。