File: hello.js

package info (click to toggle)
ngs-js 0.2.4-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 3,740 kB
  • ctags: 2,943
  • sloc: ansic: 33,936; sh: 4,827; perl: 267; makefile: 206
file content (43 lines) | stat: -rw-r--r-- 690 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
40
41
42
43
/* -*- c -*- */

function main ()
{
  System.stdout.writeln ("main(): enter");

  System.stdout.writeln ("calling our `hello' global...");
  hello ();

  System.stdout.writeln ("calling our `Hello.show' method...");
  Hello.show ();
  try
    {
      Hello.fail ();
    }
  catch (msg)
    {
      System.stdout.writeln (msg);
    }

  System.stdout.writeln ("Hello.msg=" + Hello.msg);
  try
    {
      Hello.msg = "foo";
    }
  catch (msg)
    {
      System.stdout.writeln (msg);
    }

  var h1 = new Hello ("Hello, mtr!");
  h1.show ();

  Hello.investigate (h1);

  var h2 = h1.copy ();
  h2.show ();
  Hello.investigate (h2);

  System.stdout.writeln ("main(): leave");
}

main ();