test for window in sj()

Account for the window object in sj().