|
osdir.com mailing list archive F.A.Q. -since 2001! |
|
|
|
Subject: Re: YCR2JS and Safari - msg#00033List: lang.haskell.yhc
by Date: Prev Next Date Index by Thread: Prev Next Thread Index
Hi Dimitry,
> This demo page appears totally blank to me. (Using Safari under MacOS X > 10.4.8). The Javascript console tells me there was a "Type Error line 1". I also received a message about some weird error in Opera. Under Opera its also blank to me (but an old version definately worked) The problem seems to be with this line (2620): var StdOverlay_46_95LAMBDA450=new HSFun("StdOverlay._LAMBDA450", 0, function(){return new String("function(x,y){return (x - (x % y))/y;}(exprEval(a),exprEval(b));");}); Where as far as I can see a and b are undefined? Althougth the the error message points at a syntax error, with the function(x, being the culprit Thanks Neil
Thread at a glance:
Previous Message by Date:YCR2JS and SafariMalcolm wrote: This demo page appears totally blank to me. (Using Safari under MacOS X 10.4.8). The Javascript console tells me there was a "Type Error line 1". I wish it could tell line1 of what: of the first script or whatever else (MSIE reports line number of the whole HTML). But it probably won't tell. I also received a message about some weird error in Opera. There is indeed a much smaller test (if the script size is a real problem) which just outputs into the browser's status line: http://www.golubovsky.org/repos/yhc/src/translator/js/test/Test1.html The source is here: http://www.golubovsky.org/repos/yhc/src/translator/js/test/Test1.hs It should output this (absolute nonsense) in the status line: aaa,bbb,ertyuedacdabyrvalg Does at least this one work? -- Dimitry Golubovsky Anywhere on the Web Next Message by Date:Re: YCR2JS and SafariNeil, Malcolm,On 11/13/06, Neil Mitchell <ndmitchell@xxxxxxxxx> wrote:> Hi Dimitry,> > > > This demo page appears totally blank to me. (Using Safari under MacOS X > > > 10.4.8). The _javascript_ console tells me there was a "Type Error line 1".> >> > I also received a message about some weird error in Opera.> > Under Opera its also blank to me (but an old version definately worked) > > The problem seems to be with this line (2620):> > var StdOverlay_46_95LAMBDA450=new HSFun("StdOverlay._LAMBDA450", 0,> function(){return new String("function(x,y){return (x - (x % > y))/y;}(exprEval(a),exprEval(b));");});> > Where as far as I can see a and b are undefined?> What you see indeed should not be there, but I don't know how to get rid of it. There is the `unsafeJS' pseudo-function (indeed this is kind of a macro) which takes a string literal as an argument. The converter detects such function application and creates a wrapper which is used to call this code from Haskell. So, x % y occurs in two places:var Prelude_46Prelude_46Integral_46Prelude_46Int_46quot=new HSFun("Prelude.Prelude.Integral.Prelude.Int.quot", 2, function(v26142, v26143){return function(x,y){return (x - (x % y))/y;}(Number(exprEval(v26142)),Number(exprEval(v26143)));}); This is the inlining of the QUOT_W primitive.var YHC_46Primitive_46primIntegerQuot=new HSFun("YHC.Primitive.primIntegerQuot", 2, function(a, b){ function(x,y){return (x - (x % y))/y;}(exprEval(a),exprEval(b));}); Color code: body wrapper This comes from the Overlay:global_YHC'_Primitive'_primIntegerQuot a b = unsafeJS "function(x,y){return (x - (x % y))/y;}(exprEval(a),exprEval(b));"In this function, you may see that a and b are formal arguments. The anonymous function is applied to them (after each one is forced to evaluate). What you refer to, LAMBDA450, is used for the second declaration. It was an argument to unsafeJS. What it contains inside is just a string literal, and if Safari is trying to interpret it as a code to execute, this is not a right thing. I also received a weird error report about Opera (also involving function(x,y)). I am going to ask at both browsers' forums. Maybe someone will be able to explain these problems.This runs w/o problems in Netscape, FireFox, and MSIE. -- Dimitry GolubovskyAnywhere on the Web _______________________________________________ Yhc mailing list Yhc@xxxxxxxxxxx http://www.haskell.org/mailman/listinfo/yhc Previous Message by Thread:YCR2JS and SafariMalcolm wrote: This demo page appears totally blank to me. (Using Safari under MacOS X 10.4.8). The Javascript console tells me there was a "Type Error line 1". I wish it could tell line1 of what: of the first script or whatever else (MSIE reports line number of the whole HTML). But it probably won't tell. I also received a message about some weird error in Opera. There is indeed a much smaller test (if the script size is a real problem) which just outputs into the browser's status line: http://www.golubovsky.org/repos/yhc/src/translator/js/test/Test1.html The source is here: http://www.golubovsky.org/repos/yhc/src/translator/js/test/Test1.hs It should output this (absolute nonsense) in the status line: aaa,bbb,ertyuedacdabyrvalg Does at least this one work? -- Dimitry Golubovsky Anywhere on the Web Next Message by Thread:Re: YCR2JS and SafariNeil, Malcolm,On 11/13/06, Neil Mitchell <ndmitchell@xxxxxxxxx> wrote:> Hi Dimitry,> > > > This demo page appears totally blank to me. (Using Safari under MacOS X > > > 10.4.8). The _javascript_ console tells me there was a "Type Error line 1".> >> > I also received a message about some weird error in Opera.> > Under Opera its also blank to me (but an old version definately worked) > > The problem seems to be with this line (2620):> > var StdOverlay_46_95LAMBDA450=new HSFun("StdOverlay._LAMBDA450", 0,> function(){return new String("function(x,y){return (x - (x % > y))/y;}(exprEval(a),exprEval(b));");});> > Where as far as I can see a and b are undefined?> What you see indeed should not be there, but I don't know how to get rid of it. There is the `unsafeJS' pseudo-function (indeed this is kind of a macro) which takes a string literal as an argument. The converter detects such function application and creates a wrapper which is used to call this code from Haskell. So, x % y occurs in two places:var Prelude_46Prelude_46Integral_46Prelude_46Int_46quot=new HSFun("Prelude.Prelude.Integral.Prelude.Int.quot", 2, function(v26142, v26143){return function(x,y){return (x - (x % y))/y;}(Number(exprEval(v26142)),Number(exprEval(v26143)));}); This is the inlining of the QUOT_W primitive.var YHC_46Primitive_46primIntegerQuot=new HSFun("YHC.Primitive.primIntegerQuot", 2, function(a, b){ function(x,y){return (x - (x % y))/y;}(exprEval(a),exprEval(b));}); Color code: body wrapper This comes from the Overlay:global_YHC'_Primitive'_primIntegerQuot a b = unsafeJS "function(x,y){return (x - (x % y))/y;}(exprEval(a),exprEval(b));"In this function, you may see that a and b are formal arguments. The anonymous function is applied to them (after each one is forced to evaluate). What you refer to, LAMBDA450, is used for the second declaration. It was an argument to unsafeJS. What it contains inside is just a string literal, and if Safari is trying to interpret it as a code to execute, this is not a right thing. I also received a weird error report about Opera (also involving function(x,y)). I am going to ask at both browsers' forums. Maybe someone will be able to explain these problems.This runs w/o problems in Netscape, FireFox, and MSIE. -- Dimitry GolubovskyAnywhere on the Web _______________________________________________ Yhc mailing list Yhc@xxxxxxxxxxx http://www.haskell.org/mailman/listinfo/yhc
blog comments powered by Disqus
|
|