2c19efdb by Adam Heath

This fixes a NPE in Ribets.Binding::constructor; a previous commit

reduced the size by removing access to this.options, and changing it to
options, but it was this.options that was auto-vivified into a new
object when the incoming options was null.  The fix made here also
happens to reduce the size a further 15 bytes.
1 parent e682703a
......@@ -14,7 +14,8 @@ class Rivets.Binding
# All information about the binding is passed into the constructor; the DOM
# element, the type of binding, the model object and the keypath at which
# to listen for changes.
constructor: (@el, @type, @model, @keypath, @options = {}) ->
constructor: (@el, @type, @model, @keypath, options) ->
@options = (options ||= {})
unless binder = Rivets.binders[type]
for identifier, value of Rivets.binders
if identifier isnt '*' and identifier.indexOf('*') isnt -1
......@@ -452,14 +453,16 @@ rivets =
config: Rivets.config
# Sets configuration options by merging an object literal.
configure: (options={}) ->
configure: (options) ->
options ||= {}
for property, value of options
Rivets.config[property] = value
return
# Binds a set of model objects to a parent DOM element. Returns a Rivets.View
# instance.
bind: (el, models = {}) ->
bind: (el, models) ->
models ||= {}
view = new Rivets.View(el, models)
view.bind()
view
......