narrowed scope of js instanceof fix