mirror of
https://gitlab.com/Oreolek/salet-module.git
synced 2024-07-08 01:34:24 +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.
|
# An object cannot be in several locations at once, you must clone the variable.
|
||||||
class SaletObj
|
class SaletObj
|
||||||
constructor: (spec) ->
|
constructor: (spec) ->
|
||||||
|
unless spec.name?
|
||||||
|
console.error("Trying to create an object with no name")
|
||||||
|
return null
|
||||||
for key, value of spec
|
for key, value of spec
|
||||||
this[key] = value
|
this[key] = value
|
||||||
level: 0
|
level: 0
|
||||||
|
|
Loading…
Reference in a new issue