[Seaside] Issue with JSScript code generated in a render
John Toohey
johnptoohey at gmail.com
Fri Mar 5 17:06:54 UTC 2010
In MC I reverted the javaScript-core package to build 79, then applied
the patched code. It works except that I was still getting a DNU from
the Duration>>#asMilliSeconds. Then I found this, in the class
Duration, the call to self asMilliSeconds has a lowercase s, but the
method is spelt with an uppercase one.
Old:
javascriptOn: aStream
aStream javascript: self asMilliseconds
New:
javascriptOn: aStream
aStream javascript: self asMilliSeconds
I'll let you know if the patch causes any problems, but everything
seems good now. Thanks for all your help.
On Fri, Mar 5, 2010 at 10:17, John Toohey <johnptoohey at gmail.com> wrote:
> After the applying the path the first error I get (in addition to the
> Duration asMilliseconds) is MessageNotUnderstood:
> WAHtmlDocument>>scriptGenerator, this comes from JQAjax>>render:
> aRenderable on: aStream. Assume this is still because of the latest
> js-core package that I loaded earlier.
>
> On Fri, Mar 5, 2010 at 01:43, Lukas Renggli <renggli at gmail.com> wrote:
>> That loads a pretty recent version, but not the latest code.
>>
>> Just use your old image (without updating any of the Seaside packages)
>> and apply the patch I sent you, that should solve the problem.
>>
>> Lukas
>>
>> On 5 March 2010 07:37, John Toohey <johnptoohey at gmail.com> wrote:
>>> Did a full GC, and then installed this patch, however, the DNU
>>> messages were even worse. I'm going to build a new image, but is the
>>> earlier script that I posted (Gofer), not correct to install the
>>> latest seaside?
>>>
>>> [ Gofer new
>>> squeaksource: 'Seaside30';
>>> package: 'LoadOrderTests';
>>> load ]
>>> valueSupplyingAnswers: {
>>> {'Load Seaside'. true}.
>>> {'SqueakSource User Name'. ''}.
>>> {'SqueakSource Password'. ''}.
>>> {'Run tests'. false}.
>>> }
>>>
>>>
>>> On Fri, Mar 5, 2010 at 01:11, Lukas Renggli <renggli at gmail.com> wrote:
>>>>> FIrst issue after loading the JS-Core-lr.84 was :-
>>>>>
>>>>> javascriptOn: aStream
>>>>> aStream javascript: self asMilliseconds
>>>>> Message not Understood -> Duration >> asDuration
>>>>
>>>> That's strange.
>>>>
>>>>> Then I get a :-
>>>>>
>>>>> MessageNotUnderstood: WAHtmlDocument>>scriptGenerator
>>>>
>>>> The code depends on all the latest Seaside packages. Also you need to
>>>> flush the configuration packages and re-register all applications. If
>>>> you don't want to go through that procedure you can replace JSStream
>>>> class>>#encodeString:on: with the following code. That should also
>>>> work in older images:
>>>>
>>>> JSStream class>>#encodeString: aString on: aStream
>>>> "Strings have a complicated encoding in Javascript, try to optimize
>>>> their serialization."
>>>>
>>>> | char value encoded last |
>>>> aStream nextPut: $".
>>>> 1 to: aString size do: [ :index |
>>>> char := aString at: index.
>>>> value := char greaseInteger.
>>>> value < JavascriptCharacters size
>>>> ifFalse: [ aStream nextPut: char ]
>>>> ifTrue: [
>>>> encoded := JavascriptCharacters at: value + 1.
>>>> encoded isString
>>>> ifTrue: [ aStream nextPutAll: encoded ]
>>>> ifFalse: [
>>>> "avoid that browsers mistakenly take the output as a closing tag"
>>>> (last = $< and: [ char = $/ ])
>>>> ifTrue: [ aStream nextPutAll: '\/' ]
>>>> ifFalse: [ aStream nextPut: encoded ] ] ].
>>>> last := char ].
>>>> aStream nextPut: $"
>>>>
>>>> Lukas
>>>>
>>>>
>>>> --
>>>> Lukas Renggli
>>>> http://www.lukas-renggli.ch
>>>> _______________________________________________
>>>> seaside mailing list
>>>> seaside at lists.squeakfoundation.org
>>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>>>
>>>
>>>
>>>
>>> --
>>> -JT
>>> _______________________________________________
>>> seaside mailing list
>>> seaside at lists.squeakfoundation.org
>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>>
>>
>>
>>
>> --
>> Lukas Renggli
>> http://www.lukas-renggli.ch
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>
>
>
> --
> -JT
>
--
-JT
More information about the seaside
mailing list