RAPL

Check-in [3025e9fc59]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:fixes
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:3025e9fc59bddd62bbc5f41822b49bea485d44ec
User & Date: arnulf 2012-02-22 20:32:35
Context
2012-02-22
20:37
typo fix check-in: 9cb053360b user: arnulf tags: trunk
20:32
fixes check-in: 3025e9fc59 user: arnulf tags: trunk
2012-02-21
20:30
fixe for error handling for inherit itcl command check-in: b657b1bc71 user: arnulf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to rapl_base.js.

1338
1339
1340
1341
1342
1343
1344







1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362

1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400

1401
1402
1403
1404
1405
1406
1407
1408
1409
//      list_idx.free();
//      lists_end.free();
      return result;
    },

    /* ==================== source ===================================== */
    source: function (interp, url) {







      interp.curr_file_name = url;
      url = interp.start_dir+"/"+url;
//print("source!"+url+"!"+typeof interp.win+"!");
      var xhr_object = null;
      if (interp.win != null) {
//      try {
//        if(typeof interp.win.ActiveXObject != "undefined") {    // Internet Explorer
//          xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
//        }
//      } catch(e) {
//      }
        if (xhr_object == null) {
          if(typeof interp.win.XMLHttpRequest != "undefined") { // Firefox
            xhr_object = new XMLHttpRequest();
          } else { // XMLHttpRequest not supported by the browser
            if (typeof readFile == "function") {
	      var responseText = readFile(url);
              return interp.eval_statement.evalObj(interp.string_obj_type.newStringObj(responseText), -1);

            } else {
              print("Your browser does not support XMLHTTP requests. " +
                    "Sorry that we cannot deliver this page.");
              return;
            }
          }
        }
      } else {
	var read_fcn = null;
        if (typeof readFile == "function") {
          read_fcn = readFile;
	}
        if (typeof read == "function") {
          read_fcn = read;
	}
        if (read_fcn != null) {
//print("source rhino2!"+url+"!"+interp.current_namespace.full_name+"!");
          var result = "";
          var responseText = read_fcn(url);
//print("responseText!"+responseText+"!");
          var script = interp.string_obj_type.newStringObj("::set dir "+interp.current_dir+"\n"+responseText, -1);
//print("SOURCE!"+script.len+"!"+url+"!"+script.toDebugString()+"!");
          try {
            result = interp.eval_statement.evalObj(script);
          } catch(e) {
print("SOURCE1!e!"+e+"!"+script.getString()+"!");
          }
//print("SOURCE END1!"+result+"!");
          return result;
        }
      }
//console.log("SOURCE!"+url+"!"+interp.xhr_object+"!");
      interp.xhr_object.open("GET", url, false);
      interp.xhr_object.send();
      var responseText = "::set dir "+interp.current_dir+"\n"+interp.xhr_object.responseText.toString();
      var my_obj_ptr = interp.string_obj_type.newStringObj(responseText, -1);
      my_obj_ptr.incrRefCount();
      var result = interp.eval_statement.evalObj(my_obj_ptr);

      my_obj_ptr.decrRefCount();
//print("SOURCE END2!"+result+"!");
      return result;
    },

    /* ==================== showProps ============================== */
    showProps: function(val) {
      print("props!");
      for (var z in val) {







>
>
>
>
>
>
>



|












|
|
>








|








|
|

|













|
|

|
>

<







1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410

1411
1412
1413
1414
1415
1416
1417
//      list_idx.free();
//      lists_end.free();
      return result;
    },

    /* ==================== source ===================================== */
    source: function (interp, url) {
      var result = interp.ERROR;
      var response_text;
      var script;
      var read_fcn;
      var my_obj_ptr;
      var xhr_object;

      interp.curr_file_name = url;
      url = interp.start_dir+"/"+url;
//print("source!"+url+"!"+typeof interp.win+"!");
      xhr_object = null;
      if (interp.win != null) {
//      try {
//        if(typeof interp.win.ActiveXObject != "undefined") {    // Internet Explorer
//          xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
//        }
//      } catch(e) {
//      }
        if (xhr_object == null) {
          if(typeof interp.win.XMLHttpRequest != "undefined") { // Firefox
            xhr_object = new XMLHttpRequest();
          } else { // XMLHttpRequest not supported by the browser
            if (typeof readFile == "function") {
	      responseText = readFile(url);
              var result = interp.eval_statement.evalObj(interp.string_obj_type.newStringObj(responseText), -1);
              return result
            } else {
              print("Your browser does not support XMLHTTP requests. " +
                    "Sorry that we cannot deliver this page.");
              return;
            }
          }
        }
      } else {
	read_fcn = null;
        if (typeof readFile == "function") {
          read_fcn = readFile;
	}
        if (typeof read == "function") {
          read_fcn = read;
	}
        if (read_fcn != null) {
//print("source rhino2!"+url+"!"+interp.current_namespace.full_name+"!");
          result = "";
          responseText = read_fcn(url);
//print("responseText!"+responseText+"!");
          script = interp.string_obj_type.newStringObj("::set dir "+interp.current_dir+"\n"+responseText, -1);
//print("SOURCE!"+script.len+"!"+url+"!"+script.toDebugString()+"!");
          try {
            result = interp.eval_statement.evalObj(script);
          } catch(e) {
print("SOURCE1!e!"+e+"!"+script.getString()+"!");
          }
//print("SOURCE END1!"+result+"!");
          return result;
        }
      }
//console.log("SOURCE!"+url+"!"+interp.xhr_object+"!");
      interp.xhr_object.open("GET", url, false);
      interp.xhr_object.send();
      responseText = "::set dir "+interp.current_dir+"\n"+interp.xhr_object.responseText.toString();
      my_obj_ptr = interp.string_obj_type.newStringObj(responseText, -1);
      my_obj_ptr.incrRefCount();
      result = interp.eval_statement.evalObj(my_obj_ptr);
//print("SOURCE END2!"+result+"!"+my_obj_ptr.getString().substring(0, 80)+"!");
      my_obj_ptr.decrRefCount();

      return result;
    },

    /* ==================== showProps ============================== */
    showProps: function(val) {
      print("props!");
      for (var z in val) {