[Laszlo-dev] strange error message from IE7, only in debug mode
Max Carlson
max at openlaszlo.org
Mon Aug 31 11:26:48 PDT 2009
Okay, we're only loading the 'simple' version for IE 6 and older
versions of safari:
if ((lz.embed.browser.isIE && lz.embed.browser.version < 7) ||
(lz.embed.browser.isSafari && lz.embed.browser.version <= 419.3)) {
It sounds like we should be using simple for IE 7 also... Henry did you
file a bug for this one yet? It seems pretty important!
Max Carlson wrote:
> I'll look into this... I noticed something similar in webtop (only in
> IE) where a global property was being overwritten - eek!
>
> P T Withington wrote:
>> Inspecting the function reveals:
>>
>> ERROR @lpp-8408.lzx#3: /view/view.setAttribute('valign', 'absmiddle'):
>> Invalid argument. Valid choices are: 'top', 'middle', or 'bottom'.
>> ERROR: super.open is undefined in open
>> lzx> Debug.inspect(open)
>> «Function(0)#2»
>> «Function(0)#2| open»
>> lzx> _.toString()
>> 'function open () {\nwith (this) {\n/* -*- file: lz/alert.lzx#66.13
>> -*- */\nthis.result = null;\nif (this.onresult) {\n/* -*- file: #67
>> -*- */\n/* -*- file: #68 -*- */\nthis.onresult.sendEvent(null)\n};\n/*
>> -*- file: #69 -*- */\n/* -*- file: #70 -*-
>> */\n(arguments.callee["$superclass"] &&
>> arguments.callee.$superclass.prototype["open"] ||
>> this.nextMethod(arguments.callee, "open")).call(this)\n}}'
>>
>> so, somehow, window.open is getting smashed to be this method from
>> lz.alert.
>>
>> My suspicion: IE is _still_ implementing Javascript incorrectly, and
>> when you have an expression of the form:
>>
>> var foo = function foo () ...
>>
>> It is defining the global foo, even though in a function expression
>> the name of the function is supposed to be ignored. If this is true,
>> it is amazing that anything in IE works at all.
>>
>> The server is supposed to be detecting when the client is IE and is
>> supposed to serve up the *-simple versions of the LFC (which omit
>> names from function expressions), and is also supposed to compile user
>> code with the function expression names elided (we include them
>> normally because the Firefox and Safari debugger will use them to make
>> backtraces more intelligible).
>>
>> Please file a bug. I have 3 theories: bit rot, failure to detect IE
>> in the compiler path, or, the compiler is not recording the client
>> browser bit as effecting the cache and is serving up a cached version
>> that is incorrect.
>>
>> On 2009-08-31, at 13:30, Henry Minsky wrote:
>>
>>> In a DHTML app, *only in IE7* and *only in Debug mode*, when I click
>>> right on the canvas to get the default Laszlo menu, and click on
>>> "About Openlaszlo",
>>>
>>>
>>> ERROR: super.open is undefined in open
>>> lzx> Debug.inspect(super.open is undefined in open)
>>> «LzError(39)#1» {
>>> file: null
>>> length: 39
>>> line: null
>>> message: 'super.open is undefined in open'
>>> }
>>> «LzError(39)#1| super.open is undefined in open»
>>> lzx>
>>>
>>> I believe this is happening in this LzBrowserKernel.loadURL method
>>> which tries to load a specified URL. What is weird is that this doesn't
>>> happen if I turn on backtrace, it only happens in regular debug mode.
>>>
>>>
>>> If I look at the compiled code js code, for debug mode it says this,
>>> there
>>> is
>>> no reference to super or our call-next-method
>>>
>>> Class.make("LzBrowserKernel", null, null, ["loadURL",
>>> function loadURL (url_$1, target_$2, features_$3) {
>>> /* -*- file: -*- */
>>> /* -*- file: kernel/dhtml/LzBrowserKernel.lzs#24.14 -*- */
>>> switch (arguments.length) {
>>> case 1:
>>> /* -*- file: #25 -*- */
>>> target_$2 = null;;case 2:
>>> features_$3 = null
>>> };
>>> /* -*- file: #25 -*- */
>>> if (target_$2 != null) {
>>> /* -*- file: #25 -*- */
>>> /* -*- file: #26 -*- */
>>> if (features_$3 != null) {
>>> /* -*- file: #26 -*- */
>>> /* -*- file: #27 -*- */
>>> window.open(url_$1, target_$2, features_$3)
>>> } else {
>>> /* -*- file: #28 -*- */
>>> /* -*- file: #29 -*- */
>>> window.open(url_$1, target_$2)
>>> }} else {
>>> /* -*- file: #32 -*- */
>>> window.location = url_$1
>>> }}
>>> /* -*- file: -*- */
>>> ,
>>>
>>> The code in LzBrowserKernel just calls window.open ...
>>>
>>>
>>> /**
>>> * @access private
>>> */
>>> class LzBrowserKernel {
>>>
>>> /**
>>> * Loads a URL in the browser, optionally in a target
>>> *
>>> * @param String url: URL to load
>>> * @param String target: Optionally specifies a named frame to
>>> display the
>>> contents of the URL.
>>> * The document specified by URL is loaded into the current browser
>>> frame
>>> by default.
>>> */
>>> static function loadURL ( url, target=null, features=null ){
>>> if (target != null) {
>>> if (features != null) {
>>> window.open(url, target, features);
>>> } else {
>>> window.open(url, target);
>>> }
>>> } else {
>>> window.location = url;
>>> }
>>> }
>>>
>>> --
>>> Henry Minsky
>>> Software Architect
>>> hminsky at laszlosystems.com
>>
>>
>
--
Regards,
Max Carlson
OpenLaszlo.org
More information about the Laszlo-dev
mailing list