/+junk/gjs-vapi

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/gjs-vapi

« back to all changes in this revision

Viewing changes to test.vala

  • Committer: Gustav Hartvigsson
  • Date: 2021-09-13 16:03:20 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210913160320-7ea8b6t006zr2879
* moved the path array out of the function call.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
  string js_paths[] = {"resource:///gjs/test/vapi/test/",
12
12
                       null};
13
13
  
14
 
  var ctx = (Context) GLib.Object.@new (typeof (Context) , 
15
 
                                            "program-name", "test",
16
 
                                            "search-path", js_paths);
 
14
  var ctx = new Context.with_search_path (js_paths);
 
15
  int i;
17
16
  
18
 
  int t_i;
19
17
  try {
20
 
    ctx.set_argv (args);
21
 
    var b = ctx.eval_file ("test.js", out t_i);
22
 
    print (ctx.program_name + "\n");
 
18
    var b = ctx.eval_file ("test.js", out i);
23
19
    b = bool.parse (b.to_string ());
24
20
  } catch (GLib.Error e) {
25
21
    print (e.message + "\n");
26
22
  }
27
 
  
28
23
  return 0;
29
24
}