From abc7310f11ffcbca8c4fdcd27af5ce45098192d1 Mon Sep 17 00:00:00 2001 From: bigbird231 <396016240@qq.com> Date: Wed, 8 May 2019 12:05:03 +0800 Subject: [PATCH] Update reflect.md --- docs/reflect.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/reflect.md b/docs/reflect.md index 0af5a1d..e97f16c 100644 --- a/docs/reflect.md +++ b/docs/reflect.md @@ -273,6 +273,7 @@ Reflect.deleteProperty(myObj, 'foo'); ``` 该方法返回一个布尔值。如果删除成功,或者被删除的属性不存在,返回`true`;删除失败,被删除的属性依然存在,返回`false`。 +如果第一个参数不是对象,`Reflect.deleteProperty`方法会报错。 ### Reflect.construct(target, args) @@ -290,6 +291,8 @@ const instance = new Greeting('张三'); const instance = Reflect.construct(Greeting, ['张三']); ``` +如果第一个参数不是函数,`Reflect.construct`方法会报错。 + ### Reflect.getPrototypeOf(obj) `Reflect.getPrototypeOf`方法用于读取对象的`__proto__`属性,对应`Object.getPrototypeOf(obj)`。