[{
    "code": "var msg = 'Hello, World!'; console.log(msg); console.error(msg); throw msg;",
    "result": {
        "error": {
            "ename": "string",
            "evalue": "'Hello, World!'",
            "traceback": []
        }
    },
    "stdout": "Hello, World!\n",
    "stderr": "Hello, World!\n"
},
{
    "code": "msg;",
    "result": {
        "mime": {
            "text/plain": "'Hello, World!'"
        }
    }
},
{
    "code": "'Hello, World!'",
    "result": {
        "mime": {
            "text/plain": "'Hello, World!'"
        }
    }
},
{
    "code": "throw new Error('Hello, World!')",
    "result": {
        "error": {
            "ename": "Error",
            "evalue": "Hello, World!"
        }
    }
},
{
    "code": "[] instanceof Array",
    "result": {
        "mime": {
            "text/plain": "true"
        }
    }
},
{
    "code": "var a = {}",
    "result": {
        "mime": {
            "text/plain": "undefined"
        }
    }
},
{
    "code": "a",
    "result": {
        "mime": {
            "text/plain": "{}"
        }
    }
},
{
    "code": "console.log('Hello, World!')",
    "result": {
        "mime": {
            "text/plain": "undefined"
        }
    },
    "stdout": "Hello, World!\n"
},
{
    "code": "console.error('Hello, World!')",
    "result": {
        "mime": {
            "text/plain": "undefined"
        }
    },
    "stderr": "Hello, World!\n"
},
{
    "code": "require instanceof Function",
    "result": {
        "mime": {
            "text/plain": "true"
        }
    }
},
{
    "code": "var fs = require('fs')",
    "result": {
        "mime": {
            "text/plain": "undefined"
        }
    }
},
{
    "code": "this"
},
{
    "code": "process"
},
{
    "code": "new Array(1 + 16*1024)"
},
{
    "code": "global"
},
{
    "code": "$$mime$$ = { 'text/plain': 'test' }",
    "result": {
        "mime": {
            "text/plain": "test"
        }
    }
},
{
    "code": "$$html$$ = 'test'",
    "result": {
        "mime": {
            "text/html": "test"
        }
    }
},
{
    "code": "$$svg$$ = 'test'",
    "result": {
        "mime": {
            "image/svg+xml": "test"
        }
    }
},
{
    "code": "$$png$$ = 'test'",
    "result": {
        "mime": {
            "image/png": "test"
        }
    }
},
{
    "code": "$$jpeg$$ = 'test'",
    "result": {
        "mime": {
            "image/jpeg": "test"
        }
    }
},
{
    "code": "$$async$$ = true; $$html$$ = 1;",
    "result": {
        "mime": {
            "text/html": 1
        }
    }
},
{
    "code": "$$async$$ = true; setTimeout(function() {$$html$$ = 1;}, 0);",
    "result": {
        "mime": {
            "text/html": 1
        }
    }
},
{
    "code": "$$done$$(1)",
    "result": {
        "mime": {
            "text/plain": "1"
        }
    }
},
{
    "code": "$$async$$ = true; setTimeout(function() {throw new Error(2);}, 0); $$done$$(1);",
    "result": {
        "mime": {
            "text/plain": "1"
        }
    }
},
{
    "code": "var a = {b123: {c123: {d123: {e123: {$_$: 0}}}}};",
    "result": {
        "mime": {
            "text/plain": "undefined"
        }
    }
},
{
    "code": "$$.done(1);",
    "result": {
        "mime": {
            "text/plain": "1"
        }
    }
},
{
    "code": "$$.done(1);$$.done(2);",
    "result": {
        "mime": {
            "text/plain": "1"
        }
    }
},
{
    "code": "$$.async(false);",
    "result": {
        "mime": {
            "text/plain": "false"
        }
    }
},
{
    "code": "$$.async(0);",
    "result": {
        "mime": {
            "text/plain": "false"
        }
    }
},
{
    "code": "$$.async('');",
    "result": {
        "mime": {
            "text/plain": "false"
        }
    }
},
{
    "code": "var async = $$.async(); $$.async(false); async;",
    "result": {
        "mime": {
            "text/plain": "true"
        }
    }
},
{
    "code": "$$.async(); (function($$) { setTimeout(function() { $$.done(1); }); })($$)",
    "result": {
        "mime": {
            "text/plain": "1"
        }
    }
},
{
    "code": "$$.async(); (function($$) { setTimeout(function() { $$.done(); }); })($$)"
},
{
    "code": "$$.async(); console.log(1); (function($$) { setTimeout(function() { $$.done(); }); })($$)",
    "stdout": "1\n"
},
{
    "code": "$$.async(); (function($$) { setTimeout(function() { console.log(2); $$.done(); }); })($$)",
    "stdout": "2\n"
},
{
    "code": "$$.async(); (function($$) { setTimeout(function() { $$.sendResult(1); }); })($$)",
    "result": {
        "mime": {
            "text/plain": "1"
        }
    }
},
{
    "code": "$$.sendResult(1, true); (function($$) { setTimeout(function() { $$.sendResult(2); }); })($$)",
    "result": {
        "mime": [{
            "text/plain": "1"
        }, {
            "text/plain": "2"
        }]
    }
},
{
    "code": "$$.async(); (function($$) { setTimeout(function() { $$.sendError(new Error(1)); }); })($$)",
    "result": {
        "error": {
            "ename": "Error",
            "evalue": "1"
        }
    }
},
{
    "code": "$$.sendError(new Error(1), true); (function($$) { setTimeout(function() { $$.sendError(new Error(2)); }); })($$)",
    "result": {
        "error": [{
            "ename": "Error",
            "evalue": "1"
        }, {
            "ename": "Error",
            "evalue": "2"
        }]
    }
},
{
    "code": "$$.async(); (function($$) { setTimeout(function() { $$.mime(1); }); })($$)",
    "result": {
        "mime": 1
    }
},
{
    "code": "$$.mime(1, true); (function($$) { setTimeout(function() { $$.mime(2); }); })($$)",
    "result": {
        "mime": [1, 2]
    }
},
{
    "code": "$$.async(); (function($$) { setTimeout(function() { $$.text(1); }); })($$)",
    "result": {
        "mime": {
            "text/plain": 1
        }
    }
},
{
    "code": "$$.text(1, true); (function($$) { setTimeout(function() { $$.text(2); }); })($$)",
    "result": {
        "mime": [{
            "text/plain": 1
        }, {
            "text/plain": 2
        }]
    }
},
{
    "code": "$$.async(); (function($$) { setTimeout(function() { $$.html(1); }); })($$)",
    "result": {
        "mime": {
            "text/html": 1
        }
    }
},
{
    "code": "$$.html(1, true); (function($$) { setTimeout(function() { $$.html(2); }); })($$)",
    "result": {
        "mime": [{
            "text/html": 1
        }, {
            "text/html": 2
        }]
    }
},
{
    "code": "$$.async(); (function($$) { setTimeout(function() { $$.png(1); }); })($$)",
    "result": {
        "mime": {
            "image/png": 1
        }
    }
},
{
    "code": "$$.png(1, true); (function($$) { setTimeout(function() { $$.png(2); }); })($$)",
    "result": {
        "mime": [{
            "image/png": 1
        }, {
            "image/png": 2
        }]
    }
},
{
    "code": "$$.async(); (function($$) { setTimeout(function() { $$.jpeg(1); }); })($$)",
    "result": {
        "mime": {
            "image/jpeg": 1
        }
    }
},
{
    "code": "$$.jpeg(1, true); (function($$) { setTimeout(function() { $$.jpeg(2); }); })($$)",
    "result": {
        "mime": [{
            "image/jpeg": 1
        }, {
            "image/jpeg": 2
        }]
    }
},
{
    "code": "$$.async(); (function($$) { setTimeout(function() { $$.json({x: 1}); }); })($$)",
    "result": {
        "mime": {
            "application/json": {"x": 1}
        }
    }
},
{
    "code": "$$.json({x: 1}, true); (function($$) { setTimeout(function() { $$.json({x: 2}); }); })($$)",
    "result": {
        "mime": [{
            "application/json": {"x": 1}
        }, {
            "application/json": {"x": 2}
        }]
    }
},
{
    "code": "$$.config.awaitExecution;",
    "result": {
        "mime": [{
            "text/plain": "false"
        }]
    }
},
{
    "code": "(global.Promise && $$.config.awaitExecution) ? Promise.resolve(1) : 1;",
    "result": {
        "mime": [{
            "text/plain": "1"
        }]
    }
},
{
    "code": "$$.sendResult((global.Promise) ? Promise.resolve(1) : 1);",
    "result": {
        "mime": [{
            "text/plain": "1"
        }]
    }
},
{
    "code": "$$.sendError((global.Promise) ? Promise.resolve(new Error(1)) : new Error(1));",
    "result": {
        "error": [{
            "ename": "Error",
            "evalue": "1"
        }]
    }
},
{
    "code": "$$.mime((global.Promise) ? Promise.resolve(1) : 1);",
    "result": {
        "mime": 1
    }
},
{
    "code": "$$.text((global.Promise) ? Promise.resolve(1) : 1);",
    "result": {
        "mime": [{
            "text/plain": 1
        }]
    }
},
{
    "code": "$$.html((global.Promise) ? Promise.resolve(1) : 1);",
    "result": {
        "mime": [{
            "text/html": 1
        }]
    }
},
{
    "code": "$$.svg((global.Promise) ? Promise.resolve(1) : 1);",
    "result": {
        "mime": [{
            "image/svg+xml": 1
        }]
    }
},
{
    "code": "$$.png((global.Promise) ? Promise.resolve(1) : 1);",
    "result": {
        "mime": [{
            "image/png": 1
        }]
    }
},
{
    "code": "$$.jpeg((global.Promise) ? Promise.resolve(1) : 1);",
    "result": {
        "mime": [{
            "image/jpeg": 1
        }]
    }
},
{
    "code": "$$.json((global.Promise) ? Promise.resolve(1) : 1);",
    "result": {
        "mime": [{
            "application/json": 1
        }]
    }
},
{
    "code": "$$.display().text(1);",
    "display": [{
        "mime": {
            "text/plain": 1
        }
    }]
},
{
    "code": "$$.async(); (function($$) {$$.display().text(1); $$.done();})($$);",
    "display": [{
        "mime": {
            "text/plain": 1
        }
    }]
},
{
    "code": "var $cell1 = $$.display('cell1'); $cell1.text(1);",
    "display": [{
        "display_id": "cell1",
        "mime": {
            "text/plain": 1
        }
    }]
},
{
    "code": "var $cell2 = $$.display('cell2'); $cell2.text(1); $cell2.text(2);",
    "result": {
        "mime": {
            "text/plain": "undefined"
        }
    },
    "display": [{
        "display_id": "cell2",
        "mime": {
            "text/plain": 1
        }
    }, {
        "display_id": "cell2",
        "mime": {
            "text/plain": 2
        }
    }]
},
{
    "code": "$$.display().html(1);",
    "display": [{
        "mime": {
            "text/html": 1
        }
    }]
},
{
    "code": "$$.display().svg(1);",
    "display": [{
        "mime": {
            "image/svg+xml": 1
        }
    }]
},
{
    "code": "$$.display().png(1);",
    "display": [{
        "mime": {
            "image/png": 1
        }
    }]
},
{
    "code": "$$.display().jpeg(1);",
    "display": [{
        "mime": {
            "image/jpeg": 1
        }
    }]
},
{
    "code": "$$.display().json({x: 1});",
    "display": [{
        "mime": {
            "application/json": {"x": 1}
        }
    }]
},
{
    "code": "$$.display().mime(1);",
    "display": [{
        "mime": 1
    }]
}]
