{"size": 1349, "ext": "js", "max_stars_repo_path": "tests/ecmascript/util-object.js", "max_stars_repo_name": "wenq1/duktape", "max_stars_repo_stars_event_min_datetime": "2015-01-01T17:33:40.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-31T17:53:31.000Z", "max_issues_repo_path": "tests/ecmascript/util-object.js", "max_issues_repo_name": "KiraanRK/esp32-duktape", "max_issues_repo_issues_event_min_datetime": "2015-01-01T22:43:03.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-23T22:27:19.000Z", "max_forks_repo_path": "tests/ecmascript/util-object.js", "max_forks_repo_name": "KiraanRK/esp32-duktape", "max_forks_repo_forks_event_min_datetime": "2015-01-08T14:15:28.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-31T16:29:31.000Z"}
{"max_stars_count": 4268, "max_issues_count": 1667, "max_forks_count": 565, "avg_line_length": 26.98, "max_line_length": 81, "alphanum_fraction": 0.6864343958}
function getDuktapeInfoField(val, arrIdx, propName) {
    var i = Duktape.info(val);
    if (typeof i === 'object' && i[arrIdx] !== void 0) {
        return i[arrIdx];
    } else if (typeof i === 'object' && i[propName] !== void 0) {
        return i[propName];
    }
    throw new Error('cannot parse Duktape.info() result, propName: ' + propName);
}

// Get object property count.
function getObjectPropertyCount(obj) {
    return getDuktapeInfoField(obj, 6, 'enext');
}

// Get object refcount.
function getObjectRefcount(obj) {
    return getDuktapeInfoField(obj, 2, 'refc');
}

// Get object bytecode size.
function getObjectBytecodeSize(obj) {
    return getDuktapeInfoField(obj, 9, 'bcbytes');
}

// Get object entry part size.
function getObjectEntrySize(obj) {
    return getDuktapeInfoField(obj, 5, 'esize');
}

// Get object entry part 'next' field.
function getObjectEntryNext(obj) {
    return getDuktapeInfoField(obj, 6, 'enext');
}

// Check if value is a lightfunc.
function valueIsLightFunc(val) {
    return getDuktapeInfoField(val, 0, 'type') === 9;
}

// Get public type number for a value.
function getValuePublicType(val) {
    return getDuktapeInfoField(val, 0, 'type');
}

// Get internal type tag of a value; depends on duk_tval packing.
function getValueInternalTag(val) {
    return getDuktapeInfoField(val, 1, 'itag');
}
