New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

can-view-callbacks

Package Overview
Dependencies
Maintainers
4
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-view-callbacks - npm Package Compare versions

Comparing version 3.0.0-pre.7 to 3.0.0-pre.8

12

can-view-callbacks.js

@@ -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

2

package.json
{
"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');
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc