Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5eb97ffcd1
Fetching contributors…

Cannot retrieve contributors at this time

file 38 lines (33 sloc) 1.062 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
function setup[anon,load,init]()
{
    load_bytecode("rosella/test.pbc");
    using Rosella.Test.test_list;
    using JavaScript.__store_global;
    __store_global('test_list', test_list);

    using TestObject;
    var to_proto = get_TestObject_prototype();
    var t = JavaScript.JSObject.box_function(TestObject, to_proto);
    __store_global("TestObject", t);
}

function get_TestObject_prototype()
{
    using JavaScript.__fetch_global;

    var f = __fetch_global("Function");
    var p = new JavaScript.JSObject(f.get_prototype(), null);
    var assert_class = class Rosella.Test.Asserter;
    var assert_meths = assert_class.methods();
    for (string name in assert_meths)
        p.*name = get_asserter_trampoline(name);
    return p;
}

function TestObject(var this [named])
{
    this.*"__asserter__" = new Rosella.Test.Asserter;
}

function get_asserter_trampoline(string name)
{
    return JavaScript.JSObject.box_function(function(var args[slurpy], var this [named]) {
        var a = this.*"__asserter__";
        a.*name(args:[flat]);
    });
}
Something went wrong with that request. Please try again.