Applet crashes caused by calling subclass methods (JS for Automation)

Originator:me
Number:rdar://18036148 Date Originated:15-Aug-2014
Status:Closed Resolved:Yes
Product:OS X Product Version:10.10 (14A329f)
Classification: Reproducible:Always
 
Summary:
As of Dev Preview 5 I'm seeing reproducible crashes of JS for automation applets. The crash happens when any code is run within a method of a custom subclass called from a NSButton action. This was not the case before updating from Dev Preview 4 to 5.

Steps to Reproduce:
1. Using Script Editor, create a new Application
2. Check the Stay Open after run handler option
3. Import the Cocoa library
4. Register a Subclass with no specified superclass
5. Create a custom method for the class that does nothing but NSLog a string
6. Create an instance of the Subclass
7. Create an NSButton whose target is the instance of the subclass and action is the custom method of the subclass
8. Create the necessary NSWindow and attach the button to it
9. Run the application with Script > Run Application
10. Click the button

Expected Results:
The string given should be logged to the console. The applet should stay open.

Actual Results:
The string given is logged to the console. The applet crashes.

Version:
10.10 Developer Preview 5

Notes:


Configuration:
MacBook Pro (Retina, Mid 2012)

Test Applet:
https://www.dropbox.com/s/uz51zxtmad9mus3/TestApplet.zip?dl=0

Comments

Fixed in Dev Preview 7 (Build 14A343f)

The Apple engineering team has fixed the underlying issue causing this problem in 10.10 Developer Preview 7 (Build 14A343f)


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!