0
0
Fork 0
mirror of https://gitlab.com/Oreolek/salet-module.git synced 2024-06-30 22:05:02 +03:00

Constructor name check

This commit is contained in:
Alexander Yakovlev 2016-01-17 12:29:52 +07:00
parent b9d0d3028e
commit a1d04aa459

View file

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