JavaScript object mysteriously becoming undefined when it should be impossible

Originator:kevin
Number:rdar://28970979 Date Originated:10/26/2016
Status:Open Resolved:
Product:Safari Product Version:10.0.1
Classification:Serious Bug Reproducible:Sometimes
 
Summary:
There's a really weird issue going on with one of the sites I use regularly, where every now and then it surfaces an error that looks like

undefined is not an object (evaluating 'e.message')

The problem is, in the code where it occurs, it's literally impossible for `e` to be undefined. The code sets it in all code paths leading up to this point. And the author of the site even inserted an explicit check for `if (!e)` which doesn't trigger, but then the line immediately after the if block throws the error.

AFAIK this issue is new to Safari 10, since I never saw it before I upgraded to macOS Sierra. And it's never occurred on any other browser, according to the site author.

The issue is documented in detail at https://github.com/Reviewable/Reviewable/issues/410, including a listing of the code in question.

Steps to Reproduce:
1. Use reviewable.io for a while

Expected Results:
It should work correctly

Actual Results:
Occasionally it will pop up a message saying it crashed, with that error as the reason.

Version:
Safari 10.0.1 (12602.2.14.0.7)
OS X 10.12.1 (16B2555)

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!