Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Unified Diff: third_party/jstemplate/jstemplate.js

Issue 603693002: Compile third_party/jstemplate with Closure Compiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@true_master
Patch Set: Element -> {Element} Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/jstemplate/jstemplate.js
diff --git a/third_party/jstemplate/jstemplate.js b/third_party/jstemplate/jstemplate.js
index 39cbc4dffc4fdb2fa94c293e9948e3d09e904696..ac113d403f5f4b1b39ba88e4008b866589b7ca8d 100644
--- a/third_party/jstemplate/jstemplate.js
+++ b/third_party/jstemplate/jstemplate.js
@@ -823,7 +823,7 @@ JstProcessor.prototype.jstAttributes_ = function(template) {
* returning the template.
*
* @param {string} name The ID of the HTML element used as template.
- * @param {Function} opt_loadHtmlFn A function which, when called, will return
+ * @param {Function=} opt_loadHtmlFn A function which, when called, will return
* HTML that contains an element whose ID is 'name'.
*
* @return {Element|null} The DOM node of the template. (Only element nodes
@@ -860,8 +860,10 @@ function jstGetTemplate(name, opt_loadHtmlFn) {
*/
function jstGetTemplateOrDie(name, opt_loadHtmlFn) {
var x = jstGetTemplate(name, opt_loadHtmlFn);
- check(x !== null);
- return /** @type Element */(x);
+ if (x === null) {
+ throw new Error('jstGetTemplate() returned null');
+ }
+ return /** @type {Element} */(x);
}
@@ -873,7 +875,7 @@ function jstGetTemplateOrDie(name, opt_loadHtmlFn) {
* @param {string} name
* @param {Function} loadHtmlFn A function that returns HTML to be inserted
* into the DOM.
- * @param {string} opt_target The id of a DOM object under which to attach the
+ * @param {string=} opt_target The id of a DOM object under which to attach the
* HTML once it's inserted. An object with this id is created if it does not
* exist.
* @return {Element} The node whose id is 'name'
@@ -956,12 +958,3 @@ function jstSetInstance(template, values, index) {
JstProcessor.prototype.logState_ = function(
caller, template, jstAttributeValues) {
};
-
-
-/**
- * Retrieve the processing logs.
- * @return {Array.<string>} The processing logs.
- */
-JstProcessor.prototype.getLogs = function() {
- return this.logs_;
-};

Powered by Google App Engine
This is Rietveld 408576698