Comparing version 1.0.0-rc.2 to 1.0.0-rc.3
@@ -84,4 +84,6 @@ 'use strict'; | ||
* returns. See {@link core.UID_PROPERTY}. | ||
* @type {opt_object} Optional object to be mutated with the uid. If not | ||
* specified this method only returns the uid. | ||
* @param {Object=} opt_object Optional object to be mutated with the uid. If | ||
* not specified this method only returns the uid. | ||
* @param {boolean=} opt_noInheritance Optional flag indicating if this | ||
* object's uid property can be inherited from parents or not. | ||
* @throws {Error} when invoked to indicate the method should be overridden. | ||
@@ -92,5 +94,9 @@ */ | ||
key: 'getUid', | ||
value: function getUid(opt_object) { | ||
value: function getUid(opt_object, opt_noInheritance) { | ||
if (opt_object) { | ||
return opt_object[core.UID_PROPERTY] || (opt_object[core.UID_PROPERTY] = core.uniqueIdCounter_++); | ||
var id = opt_object[core.UID_PROPERTY]; | ||
if (opt_noInheritance && !opt_object.hasOwnProperty[core.UID_PROPERTY]) { | ||
id = null; | ||
} | ||
return id || (opt_object[core.UID_PROPERTY] = core.uniqueIdCounter_++); | ||
} | ||
@@ -97,0 +103,0 @@ return core.uniqueIdCounter_++; |
{ | ||
"name": "metal", | ||
"version": "1.0.0-rc.2", | ||
"version": "1.0.0-rc.3", | ||
"description": "Build UI components in a solid, flexible way", | ||
@@ -5,0 +5,0 @@ "license": "BSD-3-Clause", |
@@ -60,10 +60,15 @@ 'use strict'; | ||
* returns. See {@link core.UID_PROPERTY}. | ||
* @type {opt_object} Optional object to be mutated with the uid. If not | ||
* specified this method only returns the uid. | ||
* @param {Object=} opt_object Optional object to be mutated with the uid. If | ||
* not specified this method only returns the uid. | ||
* @param {boolean=} opt_noInheritance Optional flag indicating if this | ||
* object's uid property can be inherited from parents or not. | ||
* @throws {Error} when invoked to indicate the method should be overridden. | ||
*/ | ||
static getUid(opt_object) { | ||
static getUid(opt_object, opt_noInheritance) { | ||
if (opt_object) { | ||
return opt_object[core.UID_PROPERTY] || | ||
(opt_object[core.UID_PROPERTY] = core.uniqueIdCounter_++); | ||
var id = opt_object[core.UID_PROPERTY]; | ||
if (opt_noInheritance && !opt_object.hasOwnProperty[core.UID_PROPERTY]) { | ||
id = null; | ||
} | ||
return id || (opt_object[core.UID_PROPERTY] = core.uniqueIdCounter_++); | ||
} | ||
@@ -70,0 +75,0 @@ return core.uniqueIdCounter_++; |
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
56631
1568