This article covers features introduced in SpiderMonkey 24

The type of the JSClass.delProperty.

Syntax

typedef bool
(* JSDeletePropertyOp)(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
                       bool *succeeded);
Name Type Description
cx JSContext *

The context in which the property access is taking place. Provides request. In JS_THREADSAFE builds, the JavaScript engine calls this callback only from within an active request on cx. The callback does not need to call JS_BeginRequest()).

obj JS::HandleObject The object whose properties are being deleted.
id JS::HandleId The name or index of the property being deleted. This is either a string (Unicode property identifier) or an integer (element index).
succeeded bool * Out parameter. Receives the result of deletion.

Description

JSDeletePropertyOp callback is a hook that applications may install to be called at some point during property access. A JSDeletePropertyOp may be installed on a JSClass to hook property deletes.

If a JSDeletePropertyOp does nothing and returns true, then property delete is unaffected. It proceeds as normal.

This callback may veto the ongoing property operation by optionally reporting an error or raising an exception and then returning false. The operation then fails, and the error is propagated to the caller. Otherwise the callback must return true, and the property operation proceeds.

JSClass hooks

JSClass offers the following hook:

See Also