Comparing version 0.1.3 to 0.1.4
{ | ||
"name": "snabbdom", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "A virtual DOM library with focus on simplicity, modularity, powerful features and performance.", | ||
@@ -5,0 +5,0 @@ "main": "snabbdom.js", |
@@ -185,3 +185,3 @@ // jshint newcap: false | ||
i = vnode.data.hook; | ||
if (!isUndef(i) && !isUndef(i = i.update)) i(vnode); | ||
if (!isUndef(i) && !isUndef(i = i.update)) i(oldVnode, vnode); | ||
} | ||
@@ -188,0 +188,0 @@ if (isUndef(vnode.text)) { |
@@ -529,4 +529,10 @@ var assert = require('assert'); | ||
it('calls `update` listener', function() { | ||
var result = []; | ||
function cb(vnode, rm) { | ||
var result1 = []; | ||
var result2 = []; | ||
function cb(result, oldVnode, vnode) { | ||
if (result.length > 0) { | ||
console.log(result[result.length-1]); | ||
console.log(oldVnode); | ||
assert.strictEqual(result[result.length-1], oldVnode); | ||
} | ||
result.push(vnode); | ||
@@ -536,5 +542,5 @@ } | ||
h('span', 'First sibling'), | ||
h('div', {hook: {update: cb}}, [ | ||
h('div', {hook: {update: cb.bind(null, result1)}}, [ | ||
h('span', 'Child 1'), | ||
h('span', {hook: {update: cb}}, 'Child 2'), | ||
h('span', {hook: {update: cb.bind(null, result2)}}, 'Child 2'), | ||
]), | ||
@@ -544,5 +550,5 @@ ]); | ||
h('span', 'First sibling'), | ||
h('div', {hook: {update: cb}}, [ | ||
h('div', {hook: {update: cb.bind(null, result1)}}, [ | ||
h('span', 'Child 1'), | ||
h('span', {hook: {update: cb}}, 'Child 2'), | ||
h('span', {hook: {update: cb.bind(null, result2)}}, 'Child 2'), | ||
]), | ||
@@ -552,3 +558,4 @@ ]); | ||
patch(vnode1, vnode2); | ||
assert.equal(result.length, 2); | ||
assert.equal(result1.length, 1); | ||
assert.equal(result2.length, 1); | ||
}); | ||
@@ -555,0 +562,0 @@ it('calls `remove` listener', function() { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
451854
30
9396
12