RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
DoubleX RMMV Object Properties

0 Members and 2 Guests are viewing this topic.

***
Scripter
Rep:
Level 36
Changelog
Code: [Select]
*      v1.00d(GMT 1500 27-1-2016):                                           
 *      1. Fixed enumerating this plugin's functions via for in loops bug     
 *      v1.00c(GMT 0100 13-11-2015):                                         
 *      1. Fixed tracing properties from null or non object object bug       
 *      v1.00b(GMT 1100 11-11-2015):                                         
 *      1. Added descriptions that will be shown in the plugin manager       
 *      v1.00a(GMT 1500 27-10-2015):                                         
 *      1. 1st version of this plugin finished                               

Authors
DoubleX

Credits
DoubleX(Optional)

Purpose
Traces all object properties meeting some conditions linked to the queried object
Designed as a bug diagnosis tool used by Javascript coders with debug experience

Plugin Calls
Code: [Select]
*============================================================================
 *    ## Plugin Call Info                                                     
 *       A path in the object property trace will stop if it'd be cyclic     
 *----------------------------------------------------------------------------
 *    # Object manipulations                                                 
 *      1. trace_obj_prop(cond, label)                                       
 *         - Traces all object properties satisfying function cond linked to 
 *           this object                                                     
 *         - Labels all traced object properties with function label         
 *         - cond and label are functions written in                         
 *           Object Property Tracing Condition Function and                   
 *           Object Property Tracing Label Function respectively             
 *      2. _obj_prop_log[cond]                                               
 *         - Returns the log of all traced object properties satisfying       
 *           function cond linked to this object                             
 *============================================================================

Configuration
Code: [Select]
    /*------------------------------------------------------------------------
     *    Object Property Tracing Condition Function                         
     *    - Setups cond used by trace_obj_prop(cond, label)                   
     *------------------------------------------------------------------------*/
    /* cond must be a function taking the object property as the only argument
       The below examples are added to help you setup your own cond functions */

    // Checks if the currently traced object's indeed an object
    cond_obj: function(obj) {
        return typeof obj === "object";
    }, // substitute cond with "cond_obj" to use this function

    // Checks if the currently traced object's an array
    cond_array: function(obj) {
        return Array.isArray(obj);
    }, // substitute cond with "cond_array" to use this function

    // Add your own cond functions here
   

    /*------------------------------------------------------------------------
     *    Object Property Tracing Label Function                             
     *    - Setups label used by trace_obj_prop(cond, label)                 
     *------------------------------------------------------------------------*/
    /* label must be a function taking the object property as the only argument
       All label functions must return a string
       The below examples are added to help you setup your own label functions */

    // Always returns the entire object
    label_obj: function(obj) {
        return obj;
    }, // substitute label with "label_obj" to use this function

    // Always returns the type(including Array) of each traced object property
    label_array: function(obj) {
        if (Array.isArray(obj)) {
            return "array";
        }
        return typeof obj;
    } // substitute label with "label_array" to use this function

    // Add your own label functions here
   

Prerequisites
Abilities:
1. Basic knowledge of inspecting object properties in Javascript
2. Some Javascript coding proficiency to fully utilize this plugin

Terms Of Use
You shall keep this plugin's Plugin Info part's contents intact
You shalln't claim that this plugin's written by anyone other than DoubleX or his aliases
None of the above applies to DoubleX or his/her aliases
« Last Edit: January 29, 2016, 12:58:09 PM by DoubleX »

***
Scripter
Rep:
Level 36
Updates
Code: [Select]
*      v1.00b(GMT 1100 11-11-2015):                                         
 *      1. Added descriptions that will be shown in the plugin manager       

***
Scripter
Rep:
Level 36
Updates
Code: [Select]
*      v1.00c(GMT 0100 13-11-2015):                                         
 *      1. Fixed tracing properties from null or non object object bug       

***
Scripter
Rep:
Level 36
Updates
Code: [Select]
*      v1.00d(GMT 1500 27-1-2016):                                           
 *      1. Fixed enumerating this plugin's functions via for in loops bug