Safari 10.1: Latest version breaks AppleScript variable output

Originator:thedov
Number:rdar://31789745 Date Originated:24-Apr-2017 01:18 PM
Status:Closed Resolved:Fixed in 10.13
Product:Safari Product Version:Safari 10.1 (12603.1.30.0.34)
Classification:Serious Bug Reproducible:Always
 
Summary:
Variable in AppleScripts that get their values from a “do JavaScript” statement that involves jQuery now get “missing value”. This worked in all prior versions of Safari

Steps to Reproduce:
1. Compile and run attached script
2. Look at script output (and events/replies)

Expected Results:
“var_name” is an array of strings

Actual Results:
An error declaring that var_name is undefined

Regression:
This worked in all prior versions of Safari. It didn’t break because of a macOS update, since my mac running El Capitan with Safari 10.1 is also similarly broken.

Notes:
This is obviously a condensed and simplified version of a more complicated script I actually use

Comments


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!