Skip to content

Commit

Permalink
pr comment
Browse files Browse the repository at this point in the history
  • Loading branch information
kmh287 committed May 15, 2017
1 parent 5090e3d commit 0c109a1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,8 @@ function registerElementClass(global, name, implementationClass, opt_css) {
*/
function prepareAndRegisterServiceForDoc(global, extensions,
name, opt_ctor, opt_factory) {
// TODO(kmh287, #9292): Refactor to remove opt_factory param and require ctor
// once #9212 has been in prod for two releases.
const ampdocService = ampdocServiceFor(global);
const ampdoc = ampdocService.getAmpDoc();
registerServiceForDoc(ampdoc, name, opt_ctor, opt_factory);
Expand All @@ -530,6 +532,8 @@ function prepareAndRegisterServiceForDoc(global, extensions,
*/
function prepareAndRegisterServiceForDocShadowMode(global, extensions,
name, opt_ctor, opt_factory) {
// TODO(kmh287, #9292): Refactor to remove opt_factory param and require ctor
// once #9212 has been in prod for two releases.
addDocFactoryToExtension(extensions, ampdoc => {
registerServiceForDoc(ampdoc, name, opt_ctor, opt_factory);
}, name);
Expand All @@ -545,8 +549,8 @@ function prepareAndRegisterServiceForDocShadowMode(global, extensions,
* @param {function(!./service/ampdoc-impl.AmpDoc):!Object=} opt_factory
*/
function registerServiceForDoc(ampdoc, name, opt_ctor, opt_factory) {
// TODO(kmh287, #9292): Refactor to remove opt_factory param once #9212 has been
// in prod for two releases.
// TODO(kmh287, #9292): Refactor to remove opt_factory param and require ctor
// once #9212 has been in prod for two releases.
// Wrapping factory in function is necessary as opt_factory could be an
// arrow function, which cannot be used as constructors.
const ctor = opt_ctor || function(ampdoc) {
Expand Down

0 comments on commit 0c109a1

Please sign in to comment.