                 if typeof n.raw is "string" and n.raw[0] is '/'
                         debug.log -> "literal regexp: #{n.raw}"
                         c = ir.createGlobalStringPtr n.raw, "strconst"
-                        regexpcall = @createCall @ejs_runtime.regexp_new_utf8, [c], "regexptmp"
+                        regexp_new_utf8 = @ejs_runtime.regexp_new_utf8
+                        regexpcall = @createCall regexp_new_utf8, [c], "regexptmp", !regexp_new_utf8.doesNotThrow
                         debug.log -> "regexpcall = #{regexpcall}"
                         return regexpcall
 

                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"
                        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

                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
