Bug fix for story #57824836 "Cannot consistently raise exception in JS adapter"

Conflicts:
	CHANGELOG.md

Backport to 4.0.  Addresses SPR 25327.