Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

do not rely on instanceof checks

bad things happens if several backbone versions loaded into interpreter
  • Loading branch information...
commit f35fc1a6e2f3cd211adf440b28292d2d3331de5f 1 parent c3e7a20
@andreypopp authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  backbone.viewdsl.coffee
  2. +1 −1  backbone.viewdsl.js
View
2  backbone.viewdsl.coffee
@@ -404,7 +404,7 @@
return o if p.trim().length == 0
for n in p.split('.')
ctx = o
- o = if (ctx instanceof Backbone.Model)
+ o = if ctx.attributes? and ctx.get?
o = ctx.get(n)
o = ctx[n] if o == undefined
o
View
2  backbone.viewdsl.js
@@ -588,7 +588,7 @@ var __hasProp = {}.hasOwnProperty,
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
n = _ref[_i];
ctx = o;
- o = ctx instanceof Backbone.Model ? (o = ctx.get(n), o === void 0 ? o = ctx[n] : void 0, o) : ctx[n];
+ o = (ctx.attributes != null) && (ctx.get != null) ? (o = ctx.get(n), o === void 0 ? o = ctx[n] : void 0, o) : ctx[n];
if (o === void 0) {
break;
}
Please sign in to comment.
Something went wrong with that request. Please try again.