mirror of
https://gitlab.com/Oreolek/salet-module.git
synced 2024-07-02 23:05:02 +03:00
Constructor name check
This commit is contained in:
parent
b9d0d3028e
commit
a1d04aa459
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue