can-view-model
Advanced tools
Comparing version 3.2.0 to 3.2.1
@@ -77,1 +77,12 @@ var QUnit = require('steal-qunit'); | ||
}); | ||
QUnit.test('elements with length property not treated as arraylikes (#31)', function() { | ||
var el = document.createElement('select'); | ||
document.getElementById('qunit-fixture').appendChild(el); | ||
QUnit.equal(el.length, 0, "Select has length property (0 for empty)"); | ||
QUnit.deepEqual(viewModel(el).get(), {}, "viewModel created on empty select"); | ||
var opt = document.createElement('option'); | ||
el.appendChild(opt); | ||
QUnit.equal(el.length, 1, "Select has length 1"); | ||
QUnit.deepEqual(viewModel(el).get(), {}, "viewModel created on non-empty select"); | ||
}); |
@@ -12,3 +12,3 @@ "use strict"; | ||
el = getDocument().querySelector(el); | ||
} else if (isArrayLike(el)) { | ||
} else if (isArrayLike(el) && !el.nodeType) { | ||
el= el[0]; | ||
@@ -15,0 +15,0 @@ } |
{ | ||
"name": "can-view-model", | ||
"version": "3.2.0", | ||
"version": "3.2.1", | ||
"description": "gets or sets the view model of an element", | ||
@@ -5,0 +5,0 @@ "homepage": "http://canjs.com", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
13327
132
1