Permalink
Browse files

Check layer value types

  • Loading branch information...
koenbok committed Sep 25, 2014
1 parent 4686f4f commit 48028d3917b789c5c9da21518829a84a038136bc
Showing with 10 additions and 0 deletions.
  1. +3 −0 framer/Layer.coffee
  2. +7 −0 test/tests/LayerTest.coffee
View
@@ -21,6 +21,9 @@ layerProperty = (obj, name, cssProperty, fallback, validator, set) ->
set: (value) ->
if value and validator and not validator(value)
throw new Error("Layer.#{name}: value '#{value}' of type '#{typeof(value)}'' is not valid")
@_properties[name] = value
@_element.style[cssProperty] = LayerStyle[cssProperty](@)
@@ -233,6 +233,13 @@ describe "Layer", ->
layer.backgroundColor.should.equal "red"
layer.style["backgroundColor"].should.equal "red"
it "should check value type", ->
f = ->
layer = new Layer
layer.x = "hello"
f.should.throw()
describe "Filter Properties", ->

0 comments on commit 48028d3

Please sign in to comment.