7.3.8 DeletePropertyOrThrow ( O, P )

抽象操作 DeletePropertyOrThrow 用于删除对象的特定属性。 如果属性不可配置,它会抛出异常。 使用参数 O P 调用操作,其中O 是对象,P 是属性键。 此抽象操作执行以下步骤:

  1. 断言: Type(O) 为 Object 类型。
  2. 断言:IsPropertyKey(P) 为 true
  3. 使 success 变为 ? O.[[Delete]](P)。
  4. 如果 success false,则抛出一个 TypeError 错误。
  5. 返回 success

results matching ""

    No results matching ""