From a1d04aa4596776dbc2267c54c6cb5ac88f42a867 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Sun, 17 Jan 2016 12:29:52 +0700 Subject: [PATCH] Constructor name check --- lib/obj.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/obj.coffee b/lib/obj.coffee index 02bc143..f8ba818 100644 --- a/lib/obj.coffee +++ b/lib/obj.coffee @@ -17,6 +17,9 @@ parsedsc = (text, name) -> # An object cannot be in several locations at once, you must clone the variable. class SaletObj constructor: (spec) -> + unless spec.name? + console.error("Trying to create an object with no name") + return null for key, value of spec this[key] = value level: 0