aboutsummaryrefslogtreecommitdiff
path: root/code_obj.lua
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-05-29 16:14:53 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-05-29 16:15:10 -0700
commit3573dfe9950d7037dfc3c48c6486d432100e6866 (patch)
treebf320c63545eb6ad51609585271568b05e14fe99 /code_obj.lua
parente17822d1e548f96952efb95c64c69704fdfeaf76 (diff)
Almost-working reimplementation of source code mapping.
Diffstat (limited to 'code_obj.lua')
-rw-r--r--code_obj.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/code_obj.lua b/code_obj.lua
index 990f3bc..2aba03d 100644
--- a/code_obj.lua
+++ b/code_obj.lua
@@ -12,6 +12,7 @@ Source = immutable({
}, {
name = "Source",
__new = function(self, filename, start, stop)
+ assert(type(filename) == 'string')
if not start then
start, stop = 1, #FILE_CACHE[filename]
end
@@ -159,7 +160,7 @@ do
if type(self.source) == 'string' then
self.source = Source:from_string(self.source)
end
- return assert(self.source)
+ return assert(self.source and Source:is_instance(self.source))
end,
__base = _base_0,
__name = "Code"