Forum > Pas2JS

Is this a bug or feature in Str()?

(1/1)

engkin:
The following project (attached) prints "undefined" in the debug console:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program strbug; {$mode objfpc}{$H+} uses  web; var  d: double;  s: string; begin  d := 3.0;  str(d:2:0, s);  console.log(s);end.
Compiled using Pas2JS 1.4.6:
ftp://ftpmaster.freepascal.org/fpc/contrib/pas2js/1.4.6/

pas2js -Jc -Jirtl.js -Tbrowser c:\pathToBugProject\strbug.pas


--- Code: XML  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---<!DOCTYPE html><HTML>  <head>    <meta charset="utf-8"/>    <Title>str bug</Title>    <script src="strbug.js" type="application/javascript"></script>  </head><body>    <div id="pasjsconsole" style="width: 640px; height: 480px;">    </div><script>  document.addEventListener("DOMContentLoaded", function(event) {    rtl.run();  });</script></body></HTML>
Bug or feature?

engkin:
Nevermind, it is a browser issue.

Navigation

[0] Message Index

Go to full version