Skip to content

Commit

Permalink
Minor changes to formatting and jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Aug 22, 2018
1 parent e00e270 commit d5935a9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
15 changes: 14 additions & 1 deletion lib/elements/dom-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,25 @@ import { strictTemplatePolicy } from '../utils/settings.js';

let modules = {};
let lcModules = {};
/**
* Sets a dom-module into the global registry by id.
*
* @param {string} id dom-module id
* @param {DomModule} module dom-module instance
* @return {void}
*/
function setModule(id, module) {
// store id separate from lowercased id so that
// in all cases mixedCase id will stored distinctly
// and lowercase version is a fallback
modules[id] = lcModules[id.toLowerCase()] = module;
}
/**
* Retrieves a dom-module from the global registry by id.
*
* @param {string} id dom-module id
* @return {DomModule!}
*/
function findModule(id) {
return modules[id] || lcModules[id.toLowerCase()];
}
Expand Down Expand Up @@ -133,7 +146,7 @@ export class DomModule extends HTMLElement {
id = id || this.id;
if (id) {
// Under strictTemplatePolicy, reject and null out any re-registered
// dom-module since it is ambiguous whether first-in or last-in is trusted
// dom-module since it is ambiguous whether first-in or last-in is trusted
if (strictTemplatePolicy && findModule(id) !== undefined) {
setModule(id, null);
throw new Error(`strictTemplatePolicy: dom-module ${id} re-registered`);
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
*
* @param {string} prop Property name
* @param {?Object} obj Reference object
* @return {string} Dereferenced value
* @return {string} Potentially renamed property name
*/
window.JSCompiler_renameProperty = function(prop, obj) {
return prop;
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/debounce.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class Debouncer {
* called once. Add this method to a custom element:
*
* ```js
* import {microtask} from '@polymer/polymer/lib/utils/async.js';
* import {microTask} from '@polymer/polymer/lib/utils/async.js';
* import {Debouncer} from '@polymer/polymer/lib/utils/debounce.js';
* // ...
*
Expand Down
2 changes: 2 additions & 0 deletions lib/utils/templatize.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ class TemplateInstanceBase extends base {
/**
* Override point for adding custom or simulated event handling.
*
* @override
* @param {!Node} node Node to add event listener to
* @param {string} eventName Name of event
* @param {function(!Event):void} handler Listener function to add
Expand Down Expand Up @@ -247,6 +248,7 @@ class TemplateInstanceBase extends base {
* textContent bindings while children are "hidden" and cache in
* private storage for later retrieval.
*
* @override
* @param {!Node} node The node to set a property on
* @param {string} prop The property to set
* @param {*} value The value to set
Expand Down
1 change: 1 addition & 0 deletions polymer-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export { html } from './lib/utils/html-tag.js';
* @summary Custom element base class that provides the core API for Polymer's
* key meta-programming features including template stamping, data-binding,
* attribute deserialization, and property change observation
* @const
*/
export const PolymerElement = ElementMixin(HTMLElement);

0 comments on commit d5935a9

Please sign in to comment.