File: javascript.e

package info (click to toggle)
entity 1.0.1-8
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 5,604 kB
  • ctags: 5,394
  • sloc: ansic: 64,242; sh: 7,377; makefile: 776; perl: 319
file content (40 lines) | stat: -rw-r--r-- 909 bytes parent folder | download | duplicates (3)
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


<object foo="false" bar="1" baz="hello" name="Hello">
 <?javascript
  
  print("This is a test.");
  
  obj = enode("object");
  print ('calling "entity:show_args", "nsi", node, "some string", 42');
  obj.call ("entity:show_args", "nsi", enode("javascript"), "some string", 42);
  
  print ("foo is", obj.attrib_is_true ("foo"), "bar is", obj.attrib_is_true ("asdf"));

  function hello (val)
  {
      bar = enode ("object");
      //bar = new ENode ("object");
      bar.attribval.bar = val;
  }

  n = enode ("object");

  attrib = n.get_set_attribs ();
  for (i=0; i < attrib.length; i++) {
      print ("node", n.path, "n.attrib." + attrib[i], "is", n.attrib[attrib[i]]);
  }

  print ("n.name is", n.attrib["name"]);
  
  for (i = 0; i < 1000000; i++) {
      //bar = new ENode ("object");
      //bar.attribval.bar = 123;
      hello (i);
      i++;
  }
  
  obj.call ("entity:exit");
 ?>
</object>