Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Stop using JavaScript keyword "interface" #22

Merged
merged 2 commits into from Jan 27, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/synapse/hooks/backbone-model.coffee
Expand Up @@ -59,8 +59,8 @@
# the what the interface refers to. Interfaces in the context of
# Backbone Models are simply data attributes. The interface is checked
# to ensure it does not represent a method on the model instance.
detectEvent: (object, interface) ->
if interface and not object[interface]
return "change:#{interface}"
detectEvent: (object, iface) ->
if iface and not object[iface]
return "change:#{iface}"
return 'change'
}
12 changes: 6 additions & 6 deletions src/synapse/hooks/backbone-view.coffee
Expand Up @@ -35,14 +35,14 @@
get: (object, name, args...) ->
[name, key] = name.split '.'
if key? then args = [key].concat(args)
if (interface = @registry[name])
return interface.get.apply(object, args)
if (iface = @registry[name])
return iface.get.apply(object, args)

set: (object, name, args...) ->
[name, key] = name.split '.'
if key? then args = [key].concat(args)
if (interface = @registry[name])
return interface.set.apply(object, args)
if (iface = @registry[name])
return iface.set.apply(object, args)

# ### Built-In interfaces
# Each setter and getter for compound interfaces are defined up front
Expand Down Expand Up @@ -288,8 +288,8 @@
detectInterface: (object) ->
el = object.$(object.el)
for item in elementInterfaces
[selector, interface] = item
if el.is(selector) then return interface
[selector, iface] = item
if el.is(selector) then return iface
return 'text'

detectOtherInterface: (object) ->
Expand Down
12 changes: 6 additions & 6 deletions src/synapse/hooks/jquery.coffee
Expand Up @@ -30,14 +30,14 @@
get: (object, name, args...) ->
[name, key] = name.split '.'
if key? then args = [key].concat(args)
if (interface = @registry[name])
return interface.get.apply(object, args)
if (iface = @registry[name])
return iface.get.apply(object, args)

set: (object, name, args...) ->
[name, key] = name.split '.'
if key? then args = [key].concat(args)
if (interface = @registry[name])
return interface.set.apply(object, args)
if (iface = @registry[name])
return iface.set.apply(object, args)

# ### Built-In interfaces
# Each setter and getter for compound interfaces are defined up front
Expand Down Expand Up @@ -271,8 +271,8 @@

detectInterface: (object) ->
for item in elementInterfaces
[selector, interface] = item
if object.is(selector) then return interface
[selector, iface] = item
if object.is(selector) then return iface
return 'text'

detectOtherInterface: (object) ->
Expand Down
12 changes: 6 additions & 6 deletions src/synapse/hooks/zepto.coffee
Expand Up @@ -31,14 +31,14 @@
get: (object, name, args...) ->
[name, key] = name.split '.'
if key? then args = [key].concat(args)
if (interface = @registry[name])
return interface.get.apply(object, args)
if (iface = @registry[name])
return iface.get.apply(object, args)

set: (object, name, args...) ->
[name, key] = name.split '.'
if key? then args = [key].concat(args)
if (interface = @registry[name])
return interface.set.apply(object, args)
if (iface = @registry[name])
return iface.set.apply(object, args)

# ### Built-In interfaces
# Each setter and getter for compound interfaces are defined up front
Expand Down Expand Up @@ -273,8 +273,8 @@

detectInterface: (object) ->
for item in elementInterfaces
[selector, interface] = item
if object.is(selector) then return interface
[selector, iface] = item
if object.is(selector) then return iface
return 'text'

detectOtherInterface: (object) ->
Expand Down