fix(classes): replace [[FunctionKind]] with [[IsClassConstructor]]

This commit is contained in:
元良 2021-05-11 15:16:19 +08:00
parent 6ab384f251
commit 5f972c8bbe

View file

@ -144,7 +144,7 @@ The result of this definition is about the same. So, there are indeed reasons wh
Still, there are important differences.
1. First, a function created by `class` is labelled by a special internal property `[[FunctionKind]]:"classConstructor"`. So it's not entirely the same as creating it manually.
1. First, a function created by `class` is labelled by a special internal property `[[IsClassConstructor]]: true`. So it's not entirely the same as creating it manually.
The language checks for that property in a variety of places. For example, unlike a regular function, it must be called with `new`: