Comparing version 5.6.0 to 5.7.0
@@ -148,4 +148,9 @@ /*global window*/ | ||
MagicPen.prototype.addStyle = function (style, handler, allowRedefinition) { | ||
if (this[style] && !allowRedefinition) { | ||
throw new Error('"' + style + '" style is already defined, set 3rd arg (allowRedefinition) to true to define it anyway'); | ||
var existingType = typeof this[style]; | ||
if (existingType === 'function') { | ||
if (!allowRedefinition) { | ||
throw new Error('"' + style + '" style is already defined, set 3rd arg (allowRedefinition) to true to define it anyway'); | ||
} | ||
} else if (existingType !== 'undefined') { | ||
throw new Error('"' + style + '" style cannot be defined, it clashes with a built-in attribute'); | ||
} | ||
@@ -152,0 +157,0 @@ |
@@ -488,4 +488,9 @@ /*! | ||
MagicPen.prototype.addStyle = function (style, handler, allowRedefinition) { | ||
if (this[style] && !allowRedefinition) { | ||
throw new Error('"' + style + '" style is already defined, set 3rd arg (allowRedefinition) to true to define it anyway'); | ||
var existingType = typeof this[style]; | ||
if (existingType === 'function') { | ||
if (!allowRedefinition) { | ||
throw new Error('"' + style + '" style is already defined, set 3rd arg (allowRedefinition) to true to define it anyway'); | ||
} | ||
} else if (existingType !== 'undefined') { | ||
throw new Error('"' + style + '" style cannot be defined, it clashes with a built-in attribute'); | ||
} | ||
@@ -492,0 +497,0 @@ |
{ | ||
"name": "magicpen", | ||
"version": "5.6.0", | ||
"version": "5.7.0", | ||
"description": "Styled output in both consoles and browsers", | ||
@@ -5,0 +5,0 @@ "main": "./lib/MagicPen.js", |
Sorry, the diff of this file is too big to display
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
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
578622
4310