Internet Explorer 9 error

With the newest openfl/lime I’m getting some errors on IE9 when targeting html5.
I know that this browser is practically dead but it worked a few months ago and I was wondering if it’s possible to fix this somehow :slight_smile:

Uint32Array never worked on IE9 but I was getting this error only when I used bytearray, now it appears even on blank project.
Second error is related to the System class in lime

#if tools
ApplicationMain.config.windows[0].background = color;
ApplicationMain.config.windows[0].element = htmlElement;
ApplicationMain.config.windows[0].width = width;
ApplicationMain.config.windows[0].height = height;
ApplicationMain.config.assetsPrefix = assetsPrefix;
ApplicationMain.create ();
#end

Anyway I’ll try to fix this on my own, but maybe there is some kind of easy fix that someone already found :slight_smile:

It’s strange that it’s not connecting with ApplicationMain.config, this works for you in other browsers?

It’s there in ApplicationMain, is DCE (dead-code elimination) enabled? Perhaps we need to flag this to be kept.

We changed the TypedArray implementation to not be based on ByteArray anymore, but abstract over Haxe bytes, it’s MUCH faster, but is meant to use real JS types, and is used all throughout OpenFL and Lime, within the renderer and certain data structures. I wonder if there is a polyfill JS that provides TypedArray support for older browsers?

I’m not using DCE, it works fine on other browsers, when targetting ie9 code inside the create function of ApplicationMain never executes. If i do something like this:

if(ApplicationMain.config == null)
 ApplicationMain.main();

app reads config just fine, however next error occurs, now in Application.hx, I wrapped lines that give me the error in try/catch:

try{
     Gamepad.onConnect.add (onGamepadConnect);
     Touch.onStart.add (onTouchStart);
     Touch.onMove.add (onTouchMove);
     Touch.onEnd.add (onTouchEnd);
}
catch(e:Dynamic){}

next error comes up in the Boot.hx in __nativeClassName function, so I used try/catch again :slight_smile: name = untyped __toStr.call(o).slice(8, -1);
and then in Stage.hx I get Unable to get value of the property ‘stage’: object is null or undefined

if (Lib.current.stage == null) {
	stage.addChild (Lib.current);			
}

Now I guess event try/catch wouldn’t help here and obviously I shouldn’t use it when dealing with the errors mentioned above. Do you have any idea why would so many errors come up?
As for array issue I found this, maybe it could help :slight_smile:

update:
replacing

name = untyped __toStr.call(o).slice(8, -1);

with

name = untyped __js__("{}.toString").call(o).slice(8, -1);

fixed error in Boot.hx, now it returns the name just fine :slight_smile: