can-view-callbacks
Advanced tools
Comparing version 3.2.2 to 3.2.3
@@ -61,2 +61,4 @@ var Observation = require('can-observation'); | ||
if(tagHandler) { | ||
var GLOBAL = getGlobal(); | ||
//!steal-remove-start | ||
@@ -71,5 +73,5 @@ if (typeof tags[tagName.toLowerCase()] !== 'undefined') { | ||
// if we have html5shiv ... re-generate | ||
if (getGlobal().html5) { | ||
getGlobal().html5.elements += " " + tagName; | ||
getGlobal().html5.shivDocument(); | ||
if (GLOBAL.html5) { | ||
GLOBAL.html5.elements += " " + tagName; | ||
GLOBAL.html5.shivDocument(); | ||
} | ||
@@ -122,3 +124,8 @@ | ||
if (!tagCallback) { | ||
dev.warn('can-view-callbacks: No custom element found for ' + tagName); | ||
var GLOBAL = getGlobal(); | ||
var ceConstructor = GLOBAL.document.createElement(tagName).constructor; | ||
// If not registered as a custom element, the browser will use default constructors | ||
if (ceConstructor === GLOBAL.HTMLElement || ceConstructor === GLOBAL.HTMLUnknownElement) { | ||
dev.warn('can-view-callbacks: No custom element found for ' + tagName); | ||
} | ||
} | ||
@@ -125,0 +132,0 @@ //!steal-remove-end |
@module {{}} can-view-callbacks can-view-callbacks | ||
@parent can-infrastructure | ||
@parent can-views | ||
@collection can-infrastructure | ||
@group can-view-callbacks/methods methods | ||
@@ -4,0 +5,0 @@ @group can-view-callbacks/types types |
{ | ||
"name": "can-view-callbacks", | ||
"version": "3.2.2", | ||
"version": "3.2.3", | ||
"description": "Registered callbacks for behaviors", | ||
@@ -20,3 +20,3 @@ "homepage": "http://canjs.com", | ||
"testee": "testee test/test.html --browsers firefox", | ||
"test": "npm run jshint && npm run testee", | ||
"test": "npm run detect-cycle && npm run jshint && npm run testee", | ||
"jshint": "jshint ./*.js --config", | ||
@@ -28,3 +28,4 @@ "release:pre": "npm version prerelease && npm publish --tag pre", | ||
"build": "node build.js", | ||
"develop": "done-serve --static --develop --port 8080" | ||
"develop": "done-serve --static --develop --port 8080", | ||
"detect-cycle": "detect-cyclic-packages --ignore done-serve" | ||
}, | ||
@@ -48,2 +49,4 @@ "main": "can-view-callbacks", | ||
"devDependencies": { | ||
"can-test-helpers": "^1.0.1", | ||
"detect-cyclic-packages": "^1.1.0", | ||
"done-serve": "^1.2.0", | ||
@@ -50,0 +53,0 @@ "jshint": "^2.9.1", |
@@ -5,3 +5,4 @@ var QUnit = require('steal-qunit'); | ||
var can = require('can-namespace'); | ||
var clone = require('steal-clone') | ||
var clone = require('steal-clone'); | ||
var devUtils = require("can-test-helpers/lib/dev"); | ||
@@ -41,3 +42,2 @@ QUnit.module('can-view-callbacks'); | ||
QUnit.test("remove a tag by passing null as second argument", function() { | ||
var callCount = 0; | ||
var tagName = "my-tag"; | ||
@@ -121,3 +121,3 @@ var handler = function() { | ||
QUnit.test("should return callback", function(){ | ||
QUnit.test("should return callback (#60)", function(){ | ||
var handler = function() {}; | ||
@@ -129,1 +129,26 @@ callbacks.attr('foo', handler); | ||
}); | ||
if(document.registerElement) { | ||
devUtils.devOnlyTest("should warn about missing custom elements (#56)", function(){ | ||
var customElement = document.createElement('custom-element'); | ||
var restore = devUtils.willWarn(/no custom element found for/i); | ||
testTagHandler(customElement); | ||
equal(restore(), 1); | ||
}); | ||
devUtils.devOnlyTest("should not warn about defined custom elements (#56)", function(){ | ||
document.registerElement('custom-element', {}); | ||
var customElement = document.createElement('custom-element'); | ||
var restore = devUtils.willWarn(/no custom element found for/i); | ||
testTagHandler(customElement); | ||
equal(restore(), 0); | ||
}); | ||
} | ||
function testTagHandler(customElement){ | ||
callbacks.tagHandler(customElement, customElement.tagName, { | ||
options: { | ||
get: function noop(){} | ||
} | ||
}); | ||
} |
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
31599
284
0
8