Fail if JS_NewUCStringCopyN returns null in str_to_jsval.