Permalink
Browse files

Throwing an error when trying to set a get-only property

  • Loading branch information...
nvh committed Jun 28, 2017
1 parent 4db0275 commit 8c43ee2f40d45c79aca1237a50fee84b5273c179
Showing with 3 additions and 3 deletions.
  1. +3 −3 framer/BaseClass.coffee
View
@@ -24,9 +24,9 @@ class exports.BaseClass extends EventEmitter
if @ isnt BaseClass
@_addDescriptor(propertyName, descriptor)
# if not descriptor.set?
# descriptor.set = (value) ->
# throw Error("#{@constructor.name}.#{propertyName} is readonly")
if not descriptor.set?
descriptor.set = (value) ->
throw Error("#{@constructor.name}.#{propertyName} is readonly")
# Define the property on the prototype
Object.defineProperty(@prototype, propertyName, descriptor)

0 comments on commit 8c43ee2

Please sign in to comment.