Object self-inspection method based on ES6

The invention discloses a javascript-based ECMAScript 6 version object self-inspection method. The method specifically comprises the following steps: step 1, self-inspection attribute configuration ofan object: the self-inspection attribute of the object is controlled by a private attribute in the o...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: LONG PINGBO, XUAN SHANMING
Format: Patent
Sprache:chi ; eng
Schlagworte:
Online-Zugang:Volltext bestellen
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:The invention discloses a javascript-based ECMAScript 6 version object self-inspection method. The method specifically comprises the following steps: step 1, self-inspection attribute configuration ofan object: the self-inspection attribute of the object is controlled by a private attribute in the object; a, defining a self-inspection attribute by a const; b, explaining a self-inspection requirement by a self-inspection attribute, and customizing a self-inspection mode and a self-inspection method; step 2, instantiating an object; (1) when an object is instantiated, assigning a value to a self-inspection attribute of the object, and (2) reconstructing get and set methods of the object by using a proxy characteristic of ES6 to achieve a self-inspection purpose, and ensuring automatic self-inspection and automatic processing of the attribute of the object by checking all attributes of the object through a self-defined rule. According to the method, the effects of other languages are simulated by utilizing some