can-view-callbacks
Advanced tools
Comparing version 3.0.0-pre.7 to 3.0.0-pre.8
@@ -48,3 +48,3 @@ var Observation = require('can-observation'); | ||
//!steal-remove-end | ||
// if we have html5shive ... re-generate | ||
// if we have html5shiv ... re-generate | ||
if (getGlobal().html5) { | ||
@@ -57,3 +57,11 @@ getGlobal().html5.elements += " " + tagName; | ||
} else { | ||
var cb = tags[tagName.toLowerCase()]; | ||
var cb; | ||
// if null is passed as tagHandler, remove tag | ||
if (tagHandler === null) { | ||
delete tags[tagName.toLowerCase()]; | ||
} else { | ||
cb = tags[tagName.toLowerCase()]; | ||
} | ||
if(!cb && automaticCustomElementCharacters.test(tagName)) { | ||
@@ -60,0 +68,0 @@ // empty callback for things that look like special tags |
{ | ||
"name": "can-view-callbacks", | ||
"version": "3.0.0-pre.7", | ||
"version": "3.0.0-pre.8", | ||
"description": "Registered callbacks for behaviors", | ||
@@ -5,0 +5,0 @@ "homepage": "http://canjs.com", |
@@ -28,3 +28,20 @@ var QUnit = require('steal-qunit'); | ||
}; | ||
// make sure tag doesn't already exist | ||
callbacks.tag(tagName, null); | ||
// add tag | ||
callbacks.tag(tagName, function(){}); | ||
}); | ||
QUnit.test("remove a tag by passing null as second argument", function() { | ||
var callCount = 0; | ||
var tagName = "my-tag"; | ||
var handler = function() { | ||
console.log('this is the handler'); | ||
}; | ||
callbacks.tag(tagName, handler); | ||
equal(callbacks.tag(tagName), handler, 'passing no second argument should get handler'); | ||
notEqual(callbacks.tag(tagName, null), handler, 'passing null as second argument should remove handler'); | ||
}); |
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
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
25236
166