1.6 <JSCWeakValue>

Class: <JSCWeakValue>

It derives from <GObject>.

JSCWeakValue represents a weak reference to a value in a <JSCContext>. It can be used to keep a reference to a JavaScript value without protecting it from being garbage collected and without referencing the <JSCContext> either.

Properties

Property: weak-value:value self

The <JSCValue> referencing the JavaScript value.

Its value is a <JSCValue>, or #f.

It can only be set when the object is made, with #:value. It cannot be read.

Procedures

Method: weak-value:get-value self ⇒ %return
Method: get-value self ⇒ %return

Get a <JSCValue> referencing the JavaScript value of self.

self

Passed: a <JSCWeakValue>.

a <JSCWeakValue>

%return

Returned: a <JSCValue>.

a new <JSCValue> or #f if self was cleared.

Procedure: weak-value:new value ⇒ %return

Create a new <JSCWeakValue> for the JavaScript value referenced by value.

value

Passed: a <JSCValue>.

a <JSCValue>

%return

Returned: a <JSCWeakValue>.

a new <JSCWeakValue>

Signals

Signal: weak-value:cleared

Connect a handler with (connect object weak-value:cleared handler). It is called as (handler self).

This signal is emitted when the JavaScript value is destroyed.

self

Passed: a <JSCWeakValue>.