From 5c44d987752e779bc6be5b8eebef68e365722f60 Mon Sep 17 00:00:00 2001 From: leaf corcoran Date: Tue, 17 Jun 2014 17:40:24 -0700 Subject: [PATCH] assert --- moonscript/errors.lua | 2 +- moonscript/errors.moon | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/moonscript/errors.lua b/moonscript/errors.lua index bdf5811..d85c316 100644 --- a/moonscript/errors.lua +++ b/moonscript/errors.lua @@ -18,7 +18,7 @@ local lookup_line lookup_line = function(fname, pos, cache) if not cache[fname] then do - local _with_0 = io.open(fname) + local _with_0 = assert(io.open(fname)) cache[fname] = _with_0:read("*a") _with_0:close() end diff --git a/moonscript/errors.moon b/moonscript/errors.moon index a6543ad..b04c567 100644 --- a/moonscript/errors.moon +++ b/moonscript/errors.moon @@ -12,7 +12,7 @@ user_error = (...) -> -- find the line number of `pos` chars into fname lookup_line = (fname, pos, cache) -> if not cache[fname] - with io.open fname + with assert io.open(fname) cache[fname] = \read "*a" \close! pos_to_line cache[fname], pos