File: test032.js

package info (click to toggle)
pyjamas 0.7~%2Bpre2-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 10,656 kB
  • ctags: 12,331
  • sloc: python: 74,493; php: 805; sh: 291; makefile: 59; xml: 9
file content (39 lines) | stat: -rw-r--r-- 847 bytes parent folder | download
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
39
function i(x) {
    return x;
}


function __Foo() {
}
function Foo() {
    var instance = new __Foo();
    if(instance.__init__) instance.__init__.apply(instance, arguments);
    return instance;
}


function __Foo_initialize() {
    if(__Foo.__was_initialized__) return;
    __Foo.__was_initialized__ = true;
    pyjs_extend(__Foo, __pyjslib_Object);
    __Foo.prototype.__class__.__new__ = Foo;
}
function test_builtins() {
    var x = new pyjslib_List([]);
    var y = pyjslib_isFunction(x);
    var z = pyjslib_map(i, x);
    pyjslib_filter(callable, z);
    pyjslib_dir(x);
    if (pyjslib_hasattr(x, 'foo')) {
    var foo = pyjslib_getattr(x, 'foo');
    }
    var f = Foo();
    pyjslib_setattr(f, 'bar', 42);
    if (pyjslib_hasattr(f, 'bar')) {
    var bar = pyjslib_getattr(f, 'bar');
    }
}


    test_builtins();
__Foo_initialize();