                 ir.setInsertPoint case_checks[0].dest_check
                 for casenum in [0...case_checks.length-1]
                         test = @visit case_checks[casenum].test
-                        discTest = @createCall @ejs_runtime["binop==="], [discr, test], "test"
+                        eqop = @ejs_runtime["binop==="]
+                        discTest = @createCall eqop, [discr, test], "test", !eqop.doesNotThrow
                         disc_truthy = @createCall @ejs_runtime.truthy, [discTest], "disc_truthy"
                         disc_cmp = ir.createICmpEq disc_truthy, consts.false(), "disccmpresult"
                         ir.createCondBr disc_cmp, case_checks[casenum+1].dest_check, case_checks[casenum].body

                rv

        visitObjectExpression: (n) ->
                obj = @createCall @ejs_runtime.object_create, [@loadNullEjsValue()], "objtmp"
                for property in n.properties
                        val = @visit property.value
                        key = property.key

                ctor = @visit args[0]

                proto = @createPropertyLoad ctor, { name: "prototype" }, false

                create = @ejs_runtime.object_create
                thisArg = @createCall create, [proto], "objtmp", !create.doesNotThrow
                                                
                argv.push ctor                                                      # %closure
                argv.push thisArg                                                   # %this
