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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
function big_array_js_test (len) {
var big = new Array(len);
for (let i=0; i < len; i ++) {
big[i]=i + 1000;
}
console.log('break here');
};
function object_js_test () {
var obj = {
a_obj: { aa: 5, ab: 'foo' },
b_arr: [ 10, 12 ]
};
return obj;
};
function getters_js_test () {
var ptd = {
get Int () { return 5; },
get String () { return "foobar"; },
get DT () { return "dt"; },
get IntArray () { return [1,2,3]; },
get DTArray () { return ["dt0", "dt1"]; },
DTAutoProperty: "dt",
StringField: "string field value"
};
console.log (`break here`);
return ptd;
}
function exception_caught_test () {
try {
throw new TypeError ('exception caught');
} catch (e) {
console.log(e);
}
}
function exception_uncaught_test () {
console.log('uncaught test');
throw new RangeError ('exception uncaught');
}
function exceptions_test () {
exception_caught_test ();
exception_uncaught_test ();
}
function negative_cfo_test (str_value = null) {
var ptd = {
get Int () { return 5; },
get String () { return "foobar"; },
get DT () { return "dt"; },
get IntArray () { return [1,2,3]; },
get DTArray () { return ["dt0", "dt1"]; },
DTAutoProperty: "dt",
StringField: str_value
};
console.log (`break here`);
return ptd;
}
|