Adobe-Runtime-Support icon indicating copy to clipboard operation
Adobe-Runtime-Support copied to clipboard

trace(Screen.mainScreen.mode) cause ReferenceError

Open itlancer opened this issue 3 years ago • 1 comments
trafficstars

Problem Description

trace(Screen.mainScreen.mode) cause ReferenceError: Error #1069: Property toString not found on flash.display.ScreenMode and there is no default value..

It has been tested with multiple AIR versions, even with latest AIR 50.0.0.1 with multiple Windows and Linux devices with different AIR applications. Same problem in all cases.

Related feature request: https://github.com/airsdk/Adobe-Runtime-Support/issues/1879

Steps to Reproduce

Launch code below. Application example with sources attached. trace_screen_mode_bug.zip

trace(Screen.mainScreen.mode);

Actual Result: Error:

ReferenceError: Error #1069: Property toString not found on flash.display.ScreenMode and there is no default value.
	at global/trace()

Expected Result: You will see in traces: [ScreenMode]

Known Workarounds

Do not trace ScreenMode objects.

itlancer avatar Sep 19 '22 11:09 itlancer

Curious one, thanks for pointing it out. Turns out the "prototype pointer" wasn't being set in the ScreenMode class constructor.. See e.g. where this is done for a Dictionary object (for our future reference, I suspect there may be other classes with this omission!)

ajwfrost avatar Sep 21 '22 05:09 ajwfrost

Fixed with latest AIR 50.0.1.1. Thanks!

itlancer avatar Oct 18 '22 10:10 itlancer