{"size": 750, "ext": "js", "max_stars_repo_path": "tests/ecmascript/test-bug-json-fastpath-boxedptr.js", "max_stars_repo_name": "jacobmarshall-etc/duktape", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "tests/ecmascript/test-bug-json-fastpath-boxedptr.js", "max_issues_repo_name": "jacobmarshall-etc/duktape", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "tests/ecmascript/test-bug-json-fastpath-boxedptr.js", "max_forks_repo_name": "jacobmarshall-etc/duktape", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.7857142857, "max_line_length": 118, "alphanum_fraction": 0.6266666667}
/*
 *  Duktape 1.3.0 JSON.stringify() fast path bug which caused a boxed pointer
 *  to be emitted as "{}" instead of being omitted.
 */

/*===
[null,null]
[null,null]
[null,null]
[null,null]
===*/

function test() {
    // Fast path enabled
    print(JSON.stringify([ Duktape.Pointer('dummy'), new Duktape.Pointer('dummy') ]));
    print(JSON.stringify([ Duktape.Buffer('dummy'), new Duktape.Buffer('dummy') ]));

    // Fast path disabled (replacer)
    print(JSON.stringify([ Duktape.Pointer('dummy'), new Duktape.Pointer('dummy') ], function id(k,v) { return v; }));
    print(JSON.stringify([ Duktape.Buffer('dummy'), new Duktape.Buffer('dummy') ], function id(k,v) { return v; }));
}

try {
    test();
} catch (e) {
    print(e.stack || e);
}
