Mercurial Hosting > luan
diff examples/blog/src/lib/Post.luan @ 1164:1f9d34a6f308
remove assertions
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 07 Feb 2018 17:36:38 -0700 |
parents | bae2d0c2576c |
children | 4721c482c86b |
line wrap: on
line diff
--- a/examples/blog/src/lib/Post.luan Tue Feb 06 22:04:47 2018 -0700 +++ b/examples/blog/src/lib/Post.luan Wed Feb 07 17:36:38 2018 -0700 @@ -1,7 +1,7 @@ local Luan = require "luan:Luan.luan" local error = Luan.error local ipairs = Luan.ipairs or error() -local assert_string = Luan.assert_string or error() +local type = Luan.type or error() local Time = require "luan:Time.luan" local now = Time.now or error() local String = require "luan:String.luan" @@ -21,8 +21,8 @@ end function Post.new(this) - assert_string(this.subject) - assert_string(this.content) + type(this.subject)=="string" or error "subject must be string" + type(this.content)=="string" or error "content must be string" this.date = this.date or now() function this.save()